Commit 33552225 by Jason Merrill

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
parent 53ee1bf3
// 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"))
{ }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment