re PR tree-optimization/32194 (ice for legal code with -O3 with complex in loop)
authorZdenek Dvorak <dvorakz@suse.cz>
Sun, 3 Jun 2007 19:21:12 +0000 (21:21 +0200)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Sun, 3 Jun 2007 19:21:12 +0000 (19:21 +0000)
PR tree-optimization/32194
* tree-predcom.c (determine_offset): Check that both references have
the same type.

From-SVN: r125298

gcc/ChangeLog
gcc/tree-predcom.c

index 2214ddf712a50d03fd7f41be61e5b811ce4fd9bc..39dd070c8d143771edcde155b5e4a87b019b8a0d 100644 (file)
@@ -1,3 +1,9 @@
+2007-06-03  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       PR tree-optimization/32194
+       * tree-predcom.c (determine_offset): Check that both references have
+       the same type.
+
 2007-06-03  Zdenek Dvorak  <dvorakz@suse.cz>
 
        * cfgloopmanip.c (remove_path, loopify, duplicate_loop_to_header_edge):
index b5c82923ee2371ac2a2a5c2711f3ee0b9a1aa42a..15fcafe76e162ab6b1914e1db0871aee638d6a0c 100644 (file)
@@ -628,6 +628,13 @@ determine_offset (struct data_reference *a, struct data_reference *b,
                  double_int *off)
 {
   aff_tree diff, baseb, step;
+  tree typea, typeb;
+
+  /* Check that both the references access the location in the same type.  */
+  typea = TREE_TYPE (DR_REF (a));
+  typeb = TREE_TYPE (DR_REF (b));
+  if (!tree_ssa_useless_type_conversion_1 (typeb, typea))
+    return false;
 
   /* Check whether the base address and the step of both references is the
      same.  */