aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2005-04-06 00:57:39 -0400
committerJason Merrill <jason@gcc.gnu.org>2005-04-06 00:57:39 -0400
commitbf7d31c1a6719fbf1e36d6dde187245636d8d558 (patch)
tree8a8e23c9a2ea1880b10a8aaf178ecc288ad75b63 /gcc
parentd34a464a99763e137ca4ad7ef30f3fe360ca708e (diff)
downloadgcc-bf7d31c1a6719fbf1e36d6dde187245636d8d558.zip
gcc-bf7d31c1a6719fbf1e36d6dde187245636d8d558.tar.gz
gcc-bf7d31c1a6719fbf1e36d6dde187245636d8d558.tar.bz2
re PR c++/19312 (ICE in stabilize_call when throwing a copy)
PR c++/19312 * tree.c (stabilize_init): Don't bother trying to stabilize something with no side-effects. From-SVN: r97691
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/tree.c5
-rw-r--r--gcc/testsuite/g++.dg/eh/throw3.C8
3 files changed, 18 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f37530d..aec7681 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/19312
+ * tree.c (stabilize_init): Don't bother trying to stabilize
+ something with no side-effects.
+
2005-04-05 Mark Mitchell <mark@codesourcery.com>
PR c++/20763
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 8b0d9aa..5d80d59 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2257,7 +2257,10 @@ stabilize_init (tree init, tree *initp)
if (TREE_CODE (t) == COND_EXPR)
return false;
- stabilize_call (t, initp);
+ /* The TARGET_EXPR might be initializing via bitwise copy from
+ another variable; leave that alone. */
+ if (TREE_SIDE_EFFECTS (t))
+ stabilize_call (t, initp);
}
return true;
diff --git a/gcc/testsuite/g++.dg/eh/throw3.C b/gcc/testsuite/g++.dg/eh/throw3.C
new file mode 100644
index 0000000..3417eeb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/throw3.C
@@ -0,0 +1,8 @@
+// PR c++/19312
+
+struct A {};
+
+void foo(A a)
+{
+ throw (A)a;
+}