Re: [PATCH] Make sibcall argument overlap check less pessimistic (PR middle-end/50074, take 2)

2011-12-04 Thread Eric Botcazou
What about this way? I've groupped the two variables into a structure to make it clear it is internal internal_arg_pointer_based_exp* state, scanning is done in a separate function and the SCAN argument is gone, instead the internal_arg_pointer_based_exp_scan function disables scanning

Re: [PATCH] Make sibcall argument overlap check less pessimistic (PR middle-end/50074, take 2)

2011-12-04 Thread Jakub Jelinek
On Sun, Dec 04, 2011 at 09:53:42PM +0100, Eric Botcazou wrote: What about this way? I've groupped the two variables into a structure to make it clear it is internal internal_arg_pointer_based_exp* state, scanning is done in a separate function and the SCAN argument is gone, instead the

Re: [PATCH] Make sibcall argument overlap check less pessimistic (PR middle-end/50074, take 2)

2011-12-04 Thread Eric Botcazou
I think it is. Those called during internal_arg_pointer_based_exp_scan will see scan_start equal to pc_rtx and won't scan, and for the calls after it, while scan_start won't be pc_rtx, as it is after scan, it is either NULL_RTX with no insns in the sequence, or some insn whose NEXT_INSN is

[PATCH] Make sibcall argument overlap check less pessimistic (PR middle-end/50074, take 2)

2011-11-29 Thread Jakub Jelinek
On Mon, Nov 28, 2011 at 11:10:56PM +0100, Eric Botcazou wrote: Here is an attempt to make the check more complete (e.g. the change wouldn't see overlap if addr was PLUS of two REGs, where one of the REGs was based on internal_arg_pointer, etc.) and less pessimistic. As tree-tailcall.c

Re: [PATCH] Make sibcall argument overlap check less pessimistic (PR middle-end/50074)

2011-11-28 Thread Eric Botcazou
Here is an attempt to make the check more complete (e.g. the change wouldn't see overlap if addr was PLUS of two REGs, where one of the REGs was based on internal_arg_pointer, etc.) and less pessimistic. As tree-tailcall.c doesn't allow tail calls from functions that have address of any of

Re: [PATCH] Make sibcall argument overlap check less pessimistic (PR middle-end/50074)

2011-11-28 Thread Jakub Jelinek
On Mon, Nov 28, 2011 at 11:10:56PM +0100, Eric Botcazou wrote: This looks reasonable, but the logic is a bit hard to follow, especially the double usage of internal_arg_pointer_based_reg depending on SCAN's value. Would it be possible to split it into 2 functions that recursively call each

[PATCH] Make sibcall argument overlap check less pessimistic (PR middle-end/50074)

2011-11-25 Thread Jakub Jelinek
Hi! Kirill's recent change to mem_overlaps_already_clobbered_arg_p resulted in various code quality regressions, many calls that used to be tail call optimized no longer are. Here is an attempt to make the check more complete (e.g. the change wouldn't see overlap if addr was PLUS of two REGs,