re PR tree-optimization/39829 (ICE with some code that produces VCE)
authorRichard Guenther <rguenther@suse.de>
Tue, 21 Apr 2009 12:42:24 +0000 (12:42 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 21 Apr 2009 12:42:24 +0000 (12:42 +0000)
2009-04-21  Richard Guenther  <rguenther@suse.de>

PR middle-end/39829
* gimple.c (walk_stmt_load_store_addr_ops): Catch addresses
inside VIEW_CONVERT_EXPRs.

* gcc.dg/torture/pr39829.c: New testcase.

From-SVN: r146521

gcc/ChangeLog
gcc/gimple.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr39829.c [new file with mode: 0644]

index bc15d1ee0e6d8073fa792c80e733555ff815e17f..589426280a583971fd924861af17ded829b3ddf4 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-21  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/39829
+       * gimple.c (walk_stmt_load_store_addr_ops): Catch addresses
+       inside VIEW_CONVERT_EXPRs.
+
 2009-04-21  Martin Jambor  <mjambor@suse.cz>
 
        * tree-switch-conversion.c (build_constructors): Split a long line.
index e499e491a07076f64a5e7af2eeba4a380eb60c02..5487cbc380d191fe5846713a6fe23fc1cc6c0406 100644 (file)
@@ -3231,6 +3231,8 @@ walk_stmt_load_store_addr_ops (gimple stmt, void *data,
            ret |= visit_store (stmt, lhs, data);
        }
       rhs = gimple_assign_rhs1 (stmt);
+      while (handled_component_p (rhs))
+       rhs = TREE_OPERAND (rhs, 0);
       if (visit_addr)
        {
          if (TREE_CODE (rhs) == ADDR_EXPR)
index d966304b5c35ad85ea905a82a525c5e03c8ac28d..066f4ea26c83b835d6227b3b1f77e9012502c868 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-21  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/39829
+       * gcc.dg/torture/pr39829.c: New testcase.
+
 2009-04-21  Martin Jambor  <mjambor@suse.cz>
 
        * gcc.dg/tree-ssa/cswtch-2.c: New test.
diff --git a/gcc/testsuite/gcc.dg/torture/pr39829.c b/gcc/testsuite/gcc.dg/torture/pr39829.c
new file mode 100644 (file)
index 0000000..da15a56
--- /dev/null
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+void foo (void * DAG_temp117584)
+{
+  char  uA;
+  void* pA;
+  void* pB;
+  void* pC;
+  do {
+      int DAG_temp117585;
+      int DAG_temp117586;
+      void ** __indir_union1 = (void**)DAG_temp117584;
+      DAG_temp117585 = (long)*__indir_union1;
+      DAG_temp117586 = DAG_temp117585;
+      if ( DAG_temp117586 != (int)268435456 )
+       pA = (void*)&uA;
+      pB = (void*)&pA;
+      pC = pB;
+      union __block_indir0_u {  struct {  long val; }  __indir_struct; }
+      * __indir_union = (union __block_indir0_u*)pC;
+      f(__indir_union->__indir_struct.val);
+
+      DAG_temp117584 += 64;
+  } while (1);
+}
+