[tree-ssa] GIMPLE grammar changes in function calls.

Diego Novillo dnovillo@redhat.com
Sat May 24 03:57:00 GMT 2003


Jason,

Right now is_simple_unary_expr is causing us to accept this as a gimple
statement:

p = (char *)malloc(100);

This causes every optimizer that needs to see if that is a function call
to fail (this showed up in libmudflap.c/pass36-frag.c).  To detect
whether the statement is a function call the optimizers test:

if (TREE_CODE (stmt) == CALL_EXPR
    || (TREE_CODE (stmt) == MODIFY_EXPR
         && TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR))

This now fails because of the NOP_EXPR on the RHS.

Removing the STRIP_NOPS we have now at the start of is_simple_unary_expr
would make things work again (at the expense of forcing the gimplifier
to create a new temporary).

This is a change in the GIMPLE grammar.  Do we want to change it?  This
means making CALL_EXPR detection a bit more cumbersome.

Another alternative is to call STRIP_NOPS *after* we check for
(cast)varname in is_simple_unary_expr.


Thoughts?


Diego.



More information about the Gcc mailing list