This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] GIMPLE grammar changes in function calls.
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: 23 May 2003 23:55:33 -0400
- Subject: [tree-ssa] GIMPLE grammar changes in function calls.
- Organization: Red Hat Canada
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.