This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/36922] [4.4 Regression] ICE in tree-data-ref.c with -ftree-loop-linear



------- Comment #4 from jakub at gcc dot gnu dot org  2008-09-15 16:49 -------
The ICE is because initialize_matrix_A doesn't expect to see BIT_NOT_EXPR,
which is created by fold:
"Convert -1 - A to ~A." and "Convert -A - 1 to ~A." cases.
I've tried to handle that:
@@ -1896,6 +1896,15 @@ initialize_matrix_A (lambda_matrix A, tr
     case INTEGER_CST:
       return chrec;

+    /* -1 - A is folded into ~A.  */
+    case BIT_NOT_EXPR:
+      {
+        tree op1 = initialize_matrix_A (A, TREE_OPERAND (chrec, 0), index,
mult);
+
+        return chrec_fold_op (MINUS_EXPR, chrec_type (chrec),
+                              build_int_cst (TREE_TYPE (chrec), -1), op1);
+      }
+
     default:
       gcc_unreachable ();
       return NULL_TREE;

but unfortunately that doesn't get us very far.
analyze_subscript_affine_affine is called with:
chrec_a: {0, +, 1}_3
chrec_b: {{(integer(kind=8)) ~{0, +, 1}_2, +, 1}_1, +, -1}_3
where nb_vars_a is (probably correctly) 1, but nb_vars_b is just 2, so it tries
to write to *A[3], which is uninitialized.  Guess more places would need to
handle BIT_NOT_EXPR, or alternatively scev needs to ensure fold doesn't fold -1
- A into ~A (or undo that folding).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36922


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]