This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] g++.dg/opt/nothrow1.C
- From: Richard Henderson <rth at twiddle dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 29 Sep 2003 10:29:06 -0700
- Subject: [tree-ssa] g++.dg/opt/nothrow1.C
Using "printf" here is a bad choice because it is a POSIX secondary
cancellation point, and thus it *can* throw, and thus the optimization
being tested for cannot be applied.
I didn't check to see if the test case pre-dates the cancellation
point changes in the C++ front end, or whether the original commit
was just sloppy. I prefer to believe the former.
r~
* g++.dg/opt/nothrow1.C: Use locally declared function rather
than printf.
Index: g++.dg/opt/nothrow1.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/opt/Attic/nothrow1.C,v
retrieving revision 1.1.2.1
diff -c -p -d -u -r1.1.2.1 nothrow1.C
--- g++.dg/opt/nothrow1.C 10 Sep 2003 20:50:08 -0000 1.1.2.1
+++ g++.dg/opt/nothrow1.C 29 Sep 2003 17:23:02 -0000
@@ -2,7 +2,7 @@
// { dg-do compile }
// { dg-options "-O -fdump-tree-optimized" }
-extern "C" int printf (const char *, ...);
+extern void blah() throw();
int i, j, k;
@@ -11,7 +11,7 @@ int main()
try
{
++i;
- printf ("foo\n");
+ blah();
++j;
}
catch (...)