On 11/01/2013 05:41 PM, Jakub Jelinek wrote:
On Fri, Nov 01, 2013 at 05:36:34PM -0400, Andrew MacLeod wrote:
static inline void
! gimple_call_set_lhs (gimple gs, tree lhs)
{
- GIMPLE_CHECK (gs, GIMPLE_CALL);
gimple_set_op (gs, 0, lhs);
to
static inline void
! gimple_call_set_lhs (gimple_statement_call *gs, tree lhs)
{
gimple_set_op (gs, 0, lhs);
but then every location that calls it needs an appropriate change:
! gimple call;
! call = gimple_build_call_vec (build_fold_addr_expr_loc (0,
alias), vargs);
gimple_call_set_lhs (call, atree);
--- 1518,1524 ----
! gimple_statement_call *call;
! call = as_a<gimple_statement_call> (gimple_build_call_vec
(build_fold_addr_expr_loc (0, alias), vargs));
gimple_call_set_lhs (call, atree);
And in fact there is a ripple effect to then change
gimple_build_call_vec to simply return a gimple_statement_call *...
Then this doesn't look as ugly either...
! gimple_statement_call *call;
! call = gimple_build_call_vec (build_fold_addr_expr_loc (0,
alias), vargs);
gimple_call_set_lhs (call, atree);
that is looking much better :-)
Do you seriously think this is an improvement? The cost of changing
the --enable-checking=yes cost to compile time checking in either
cases sounds way too high to me. Please don't.
What checking? There ought to be no checking at all in this example...
gimple_build_call_vec returns a gimple_call, and gimple_call_set_lhs()
doesn't have to check anything because it only accepts gimple_call's..
so there is no checking other than the usual "does my parameter match"
that the compiler has to do...
What extra are you expecting?
Andrew