diff options
| author | Richard Guenther <rguenther@suse.de> | 2011-04-12 10:44:15 +0000 |
|---|---|---|
| committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-04-12 10:44:15 +0000 |
| commit | f20ca7258739d74b12cf381293b10f72125732c5 (patch) | |
| tree | e792618dd649e3a0226cbeeef5d614d64ccfe552 /gcc/gimple.h | |
| parent | 78a869ec7471a7c86d992a4cd3a506f5538995fc (diff) | |
| download | gcc-f20ca7258739d74b12cf381293b10f72125732c5.zip gcc-f20ca7258739d74b12cf381293b10f72125732c5.tar.gz gcc-f20ca7258739d74b12cf381293b10f72125732c5.tar.bz2 | |
re PR tree-optimization/46076 (constant propagation and compile-time math no longer happening versus 4.4 and 4.5)
2011-04-12 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46076
* gimple.h (struct gimple_statement_call): Add fntype field.
(gimple_call_fntype): Adjust.
(gimple_call_set_fntype): New function.
* gimple.c (gimple_build_call_1): Set the call function type.
* gimplify.c (gimplify_call_expr): Preserve the function
type the frontend used for the call.
(gimplify_modify_expr): Likewise.
* lto-streamer-in.c (input_gimple_stmt): Input the call stmts
function type.
* lto-streamer-out.c (output_gimple_stmt): Output the call stmts
function type.
* tree-ssa.c (useless_type_conversion_p): Function pointer
conversions are useless.
* gcc.dg/tree-ssa/pr46076.c: Un-XFAIL.
From-SVN: r172310
Diffstat (limited to 'gcc/gimple.h')
| -rw-r--r-- | gcc/gimple.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h index be45e4b..572cabc 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -405,7 +405,10 @@ struct GTY(()) gimple_statement_call struct pt_solution call_used; struct pt_solution call_clobbered; - /* [ WORD 13 ] + /* [ WORD 13 ] */ + tree fntype; + + /* [ WORD 14 ] Operand vector. NOTE! This must always be the last field of this structure. In particular, this means that this structure cannot be embedded inside another one. */ @@ -2001,22 +2004,33 @@ gimple_call_set_lhs (gimple gs, tree lhs) } -/* Return the tree node representing the function called by call - statement GS. */ +/* Return the function type of the function called by GS. */ static inline tree -gimple_call_fn (const_gimple gs) +gimple_call_fntype (const_gimple gs) { GIMPLE_CHECK (gs, GIMPLE_CALL); - return gimple_op (gs, 1); + return gs->gimple_call.fntype; } -/* Return the function type of the function called by GS. */ +/* Set the type of the function called by GS to FNTYPE. */ + +static inline void +gimple_call_set_fntype (gimple gs, tree fntype) +{ + GIMPLE_CHECK (gs, GIMPLE_CALL); + gs->gimple_call.fntype = fntype; +} + + +/* Return the tree node representing the function called by call + statement GS. */ static inline tree -gimple_call_fntype (const_gimple gs) +gimple_call_fn (const_gimple gs) { - return TREE_TYPE (TREE_TYPE (gimple_call_fn (gs))); + GIMPLE_CHECK (gs, GIMPLE_CALL); + return gimple_op (gs, 1); } /* Return a pointer to the tree node representing the function called by call |
