]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/27830 (ICE: verify_stmts failed (invalid operand to unary...
authorRichard Guenther <rguenther@suse.de>
Tue, 13 Jun 2006 07:22:04 +0000 (07:22 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 13 Jun 2006 07:22:04 +0000 (07:22 +0000)
2006-06-13  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/27830
* tree-inline.c (copy_body_r): For copying the operand
of an ADDR_EXPR make sure to fold &* afterwards.

* g++.dg/tree-ssa/pr27830.C: New testcase.

From-SVN: r114600

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr27830.C [new file with mode: 0644]
gcc/tree-inline.c

index 59b9e4fc5c5628eb5268d0844f268e84c6bba033..7798dd053d8738f9e0a23c782ad51832db973202 100644 (file)
@@ -1,3 +1,9 @@
+2006-06-13  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/27830
+       * tree-inline.c (copy_body_r): For copying the operand
+       of an ADDR_EXPR make sure to fold &* afterwards.
+
 2006-06-12  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gimplify.c (gimplify_expr): Treat VIEW_CONVERT_EXPR like other
index 55d6788198f811fbe591e0f54a4fe611d7a87b48..fa0ecd5fb7c20bfbe5b3f6c3c66b404271b33519 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-13  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/27830
+       * g++.dg/tree-ssa/pr27830.C: New testcase.
+
 2006-06-13  Matthew Sachs  <msachs@apple.com>
 
        * lib/target-supports-dg.exp (check-flags): Include TOOL_OPTIONS in
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr27830.C b/gcc/testsuite/g++.dg/tree-ssa/pr27830.C
new file mode 100644 (file)
index 0000000..01c7fc1
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+struct gc{};
+struct transform:public gc
+{
+    double x, y, z, t;
+    transform (void){}
+};
+inline transform f (void)
+{
+    return transform ();
+};
+void transformed (void)
+{
+    new transform (f());
+}
+
index 309bb406fb8ed320965e74c2ee2275734655ae24..3aeb7b61341cd9ff20515da7f831822cef87b549 100644 (file)
@@ -659,7 +659,12 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
       else if (TREE_CODE (*tp) == ADDR_EXPR)
        {
          walk_tree (&TREE_OPERAND (*tp, 0), copy_body_r, id, NULL);
-         recompute_tree_invariant_for_addr_expr (*tp);
+         /* Handle the case where we substituted an INDIRECT_REF
+            into the operand of the ADDR_EXPR.  */
+         if (TREE_CODE (TREE_OPERAND (*tp, 0)) == INDIRECT_REF)
+           *tp = TREE_OPERAND (TREE_OPERAND (*tp, 0), 0);
+         else
+           recompute_tree_invariant_for_addr_expr (*tp);
          *walk_subtrees = 0;
        }
     }