Patch: PR40900, extending call patterns

Eric Botcazou ebotcazou@adacore.com
Wed Jun 9 22:14:00 GMT 2010


> I've looked into this now, and I don't really see a way to do better at
> rtl expansion time.

IIRC I did manage to get your testcase optimized with only a few changed lines 
in expr.c.  I can try again, but not before the end of the week.

> In current sources, the function ends up as
>   D.2006_1 = shortv2 (); [tail call]
>   return D.2006_1;
>
> PROMOTE_MODE ensures that D.2006_1 becomes
>   #0  store_expr (exp=0xf7cbb5e8, target=0xf7d2c5ac, call_param_p=0,
>       nontemporal=0 '\000') at ../../trunk/gcc/expr.c:4582
>   4582	      rtx inner_target = 0;
>   (gdb) p target(gdb) p debug_rtx (target)
>   (subreg/s/u:HI (reg:SI 133 [ D.2006 ]) 0)

The root of the problem, this unsigned extension must never be generated or 
the game is indeed over.  Instead of a signed one should, by switching to 
PROMOTE_FUNCTION_MODE in this particular case (lhs of a call).

-- 
Eric Botcazou



More information about the Gcc-patches mailing list