]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/34458 (ICE in int_cst_value, at tree.c:8047 at -O3)
authorRichard Guenther <rguenther@suse.de>
Wed, 9 Jan 2008 14:17:13 +0000 (14:17 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 9 Jan 2008 14:17:13 +0000 (14:17 +0000)
2008-01-09  Richard Guenther  <rguenther@suse.de>

PR middle-end/34458
* tree-data-ref.c (initialize_matrix_A): Use tree_low_cst,
adjust return type.

* gcc.c-torture/compile/pr34458.c: New testcase.

From-SVN: r131429

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr34458.c [new file with mode: 0644]
gcc/tree-data-ref.c

index f4ff71b28159b32d1fbba200a8ba7b60d2b6e3fe..acfca73d9e810cd62f758ef04ddb4ef1e85ef684 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-09  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/34458
+       * tree-data-ref.c (initialize_matrix_A): Use tree_low_cst,
+       adjust return type.
+
 2008-01-09  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/34679
index 8e2b6281f40ff25fa89ab475d8b531414e4500c5..78f54391a06f611cc19e988dcb5d1aedc1b4d2dd 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-09  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/34458
+       * gcc.c-torture/compile/pr34458.c: New testcase.
+
 2008-01-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR testsuite/30459
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr34458.c b/gcc/testsuite/gcc.c-torture/compile/pr34458.c
new file mode 100644 (file)
index 0000000..096cc0c
--- /dev/null
@@ -0,0 +1,16 @@
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+
+typedef struct
+{
+  int data[1024];
+}
+Lint;
+Lint lint_operate (Lint a, long long ammount)
+{
+  int index;
+  Lint ret;
+  for (index = 0; index < 24; index++)
+    ret.data[index] =
+      a.data[index + ammount / 32 + 1] << a.data[index + ammount / 32];
+  return ret;
+}
index 88f6347f777d8afd7ba8adec05999bc118285c2e..e4ac89a67b0748b6ebb25bded7dfdcc39c6134bb 100644 (file)
@@ -1820,15 +1820,24 @@ analyze_siv_subscript_cst_affine (tree chrec_a,
 /* Helper recursive function for initializing the matrix A.  Returns
    the initial value of CHREC.  */
 
-static int
+static HOST_WIDE_INT
 initialize_matrix_A (lambda_matrix A, tree chrec, unsigned index, int mult)
 {
+  tree type;
+
   gcc_assert (chrec);
 
+  type = TREE_TYPE (chrec);
   if (TREE_CODE (chrec) != POLYNOMIAL_CHREC)
-    return int_cst_value (chrec);
-
-  A[index][0] = mult * int_cst_value (CHREC_RIGHT (chrec));
+    return tree_low_cst (chrec, TYPE_UNSIGNED (type)
+                               && !(TREE_CODE (type) == INTEGER_TYPE
+                                    && TYPE_IS_SIZETYPE (type)));
+
+  type = TREE_TYPE (CHREC_RIGHT (chrec));
+  A[index][0] = mult * tree_low_cst (CHREC_RIGHT (chrec),
+                                    TYPE_UNSIGNED (type)
+                                    && !(TREE_CODE (type) == INTEGER_TYPE
+                                         && TYPE_IS_SIZETYPE (type)));
   return initialize_matrix_A (A, CHREC_LEFT (chrec), index + 1, mult);
 }