[polly] r247412 - Fix out-of-range access in test case

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 06:45:06 PDT 2015


Author: meinersbur
Date: Fri Sep 11 08:45:05 2015
New Revision: 247412

URL: http://llvm.org/viewvc/llvm-project?rev=247412&view=rev
Log:
Fix out-of-range access in test case

The function use_after_scop would iterate from 0 to 1024 and accessing element A[1024] where A has only valid indexes from 0 to 1023. Polly detects the situation of unconditionally undefined behavior and bail out in ScopInfo as non-feasible for optimization.

Other tests add impossible context assumptions as well, hance might show the same problem.

Modified:
    polly/trunk/test/TempScop/scalar_to_array.ll

Modified: polly/trunk/test/TempScop/scalar_to_array.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/TempScop/scalar_to_array.ll?rev=247412&r1=247411&r2=247412&view=diff
==============================================================================
--- polly/trunk/test/TempScop/scalar_to_array.ll (original)
+++ polly/trunk/test/TempScop/scalar_to_array.ll Fri Sep 11 08:45:05 2015
@@ -128,7 +128,7 @@ for.body:
 
 for.inc:                                          ; preds = %for.body
   %indvar.next = add i64 %indvar, 1
-  %exitcond = icmp ne i64 %indvar, 1024
+  %exitcond = icmp ne i64 %indvar.next, 1024
   br i1 %exitcond, label %for.head, label %for.after
 
 for.after:                                        ; preds = %for.inc




More information about the llvm-commits mailing list