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
This commit is contained in:
Jason Merrill 2003-11-14 03:17:45 -05:00
parent 53ee1bf364
commit 33552225d0
1 changed files with 19 additions and 0 deletions

View File

@ -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"))
{ }
}