]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/39636 (ICE in gimple_assign_rhs_code, at gimple.h:1837, 435...
authorRichard Guenther <rguenther@suse.de>
Sat, 4 Apr 2009 09:30:34 +0000 (09:30 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 4 Apr 2009 09:30:34 +0000 (09:30 +0000)
2009-04-04  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/39636
* tree-ssa-forwprop.c
(forward_propagate_addr_into_variable_array_index): Check for
GIMPLE_ASSIGN before accessing the rhs code.

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

From-SVN: r145532

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr39636.c [new file with mode: 0644]
gcc/tree-ssa-forwprop.c

index 817d483d38cd474eb4e2ccec6da85ca1dc2d98b0..18fb789461fa9a197ed0234bab20471a886b2943 100644 (file)
@@ -1,3 +1,10 @@
+2009-04-04  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/39636
+       * tree-ssa-forwprop.c
+       (forward_propagate_addr_into_variable_array_index): Check for
+       GIMPLE_ASSIGN before accessing the rhs code.
+
 2009-04-03  Jason Merrill  <jason@redhat.com>
 
        * stor-layout.c (set_sizetype): Set TYPE_CANONICAL.
index 45e0c115c72f73ff2add0b199f2965017e339aa5..3e322f5524d4b6e13a281221c9910426ecc6ccb0 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-04  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/39636
+       * gcc.c-torture/compile/pr39636.c: New testcase.
+
 2009-04-03  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR rtl-optimization/39607
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39636.c b/gcc/testsuite/gcc.c-torture/compile/pr39636.c
new file mode 100644 (file)
index 0000000..ceddbb3
--- /dev/null
@@ -0,0 +1,11 @@
+typedef float real;
+typedef real rvec[3];
+void calc_dx2dx(real *, real *);
+void phi_sr(int nj,rvec x[],int k)
+{
+  int i,j;
+  for(i=0; (i<nj-1); i++)
+    for(j=i+1; (j<nj); j++)
+      if (k)
+       calc_dx2dx(x[i],x[j]);
+}
index c3e7d432528627fca812e1e53638ef264fdb6020..ff6bda0b1de87cd1cedb4363ef3ddc25c4ffb876 100644 (file)
@@ -668,7 +668,8 @@ forward_propagate_addr_into_variable_array_index (tree offset,
                                               tunit)) != NULL_TREE)
        {
         gimple offset_def2 = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (offset_def));
-        if (gimple_assign_rhs_code (offset_def2) == MULT_EXPR
+        if (is_gimple_assign (offset_def2)
+            && gimple_assign_rhs_code (offset_def2) == MULT_EXPR
             && TREE_CODE (gimple_assign_rhs2 (offset_def2)) == INTEGER_CST
             && tree_int_cst_equal (gimple_assign_rhs2 (offset_def2), tunit))
           {
This page took 0.098715 seconds and 5 git commands to generate.