aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2003-11-14 03:17:45 -0500
committerJason Merrill <jason@gcc.gnu.org>2003-11-14 03:17:45 -0500
commit33552225d09e3b71b9bc640b4badf17bc731144d (patch)
tree2ce08c8bfd68fc367128886e360f1df5321c96da /gcc
parent53ee1bf364053cbd75a451f449288caff1792a27 (diff)
downloadgcc-33552225d09e3b71b9bc640b4badf17bc731144d.zip
gcc-33552225d09e3b71b9bc640b4badf17bc731144d.tar.gz
gcc-33552225d09e3b71b9bc640b4badf17bc731144d.tar.bz2
re PR middle-end/12526 ([tree-ssa] internal compiler error: Segmentation fault)
PR middle-end/12526 * tree.c (build): A CALL_EXPR has side-effects if its arguments do. * calls.c (call_expr_flags): New fn. * tree.h: Declare it. * tree-cfg.c (call_expr_flags): Move to calls.c. * tree-flow.h: Move prototype to tree.h. From-SVN: r73588
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/init/cleanup2.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/init/cleanup2.C b/gcc/testsuite/g++.dg/init/cleanup2.C
new file mode 100644
index 0000000..e62364b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/cleanup2.C
@@ -0,0 +1,19 @@
+// PR c++/12526
+
+// We decided that the call to strcmp has no side-effects because strcmp is
+// pure, even though the first argument has side-effects. As a result, we
+// stripped the CLEANUP_POINT_EXPR. Hilarity ensued.
+
+extern "C" int strcmp (const char *, const char *);
+
+struct A {
+ A(int);
+ const char *str();
+ ~A();
+};
+
+void printQueryI()
+{
+ if(!strcmp(A(1).str(), "foo"))
+ { }
+}