This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]