aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-08-12 19:57:49 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-08-12 19:57:49 +0200
commit4c29307df9fef2001418b25babd1018a12d8687b (patch)
tree8ea0e258c24d36033da004d3d69b1955d768eef5 /gcc
parentd0259b010bcc7b81c08a382e2176aba7d7c4fec7 (diff)
downloadgcc-4c29307df9fef2001418b25babd1018a12d8687b.zip
gcc-4c29307df9fef2001418b25babd1018a12d8687b.tar.gz
gcc-4c29307df9fef2001418b25babd1018a12d8687b.tar.bz2
re PR tree-optimization/37084 (ICE in gimple_assign_rhs1)
PR tree-optimization/37084 * tree-inline.c (copy_bb): Call gimple_regimplify_operands if id->regimplify, don't assume stmt is a cast assignment. * g++.dg/tree-ssa/pr37084.C: New test. From-SVN: r139028
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr37084.C16
-rw-r--r--gcc/tree-inline.c7
4 files changed, 30 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1b41d51..f60e34b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/37084
+ * tree-inline.c (copy_bb): Call gimple_regimplify_operands
+ if id->regimplify, don't assume stmt is a cast assignment.
+
2008-08-12 Anatoly Sokolov <aesok@post.ru>
* final.c (final_scan_insn): Use app_enable/app_disable functions.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 427c066..692e83f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/37084
+ * g++.dg/tree-ssa/pr37084.C: New test.
+
2008-08-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* gcc.c-torture/execute/20031003-1.c (main): Update test to
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr37084.C b/gcc/testsuite/g++.dg/tree-ssa/pr37084.C
new file mode 100644
index 0000000..8fceb0c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr37084.C
@@ -0,0 +1,16 @@
+// PR tree-optimization/37084
+// { dg-do compile }
+// { dg-options "-O" }
+
+struct A
+{
+ A ();
+};
+
+inline A
+foo ()
+{
+ return A ();
+}
+
+const A a (foo ());
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 4eeabb1..ef9e75c 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1260,10 +1260,9 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
/* With return slot optimization we can end up with
non-gimple (foo *)&this->m, fix that here. */
- if ((is_gimple_assign (stmt)
- && gimple_assign_rhs_code (stmt) == NOP_EXPR
- && !is_gimple_val (gimple_assign_rhs1 (stmt)))
- || id->regimplify)
+ if (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == NOP_EXPR
+ && !is_gimple_val (gimple_assign_rhs1 (stmt)))
{
tree new_rhs;
new_rhs = force_gimple_operand_gsi (&copy_gsi,