[PATCH 2/2] refactor emit_*_{after,before}{,_setloc} using common functions

Richard Henderson rth@redhat.com
Wed Mar 23 00:07:00 GMT 2011


On 03/22/2011 04:13 PM, Nathan Froyd wrote:
> rtx
> emit_call_insn_before_setloc (rtx pattern, rtx before, int loc)
> {
>   ...
>   if (pattern == NULL_RTX)
>     return last;
> 
>   first = NEXT_INSN (first);
> 
> The jump_insn and debug_insn variants have identical behavior to
> call_insn.

AFAICT, the !loc test really ought to be loc != UNKNOWN_LOCATION,
and ought to apply to all of the patterns.  This makes sense once
you look at the test written canonically -- no point in searching
for the list of insns if there's no location to set.

Further, the !first test can be applied everywhere.  This handles
the edge condition of emitting an insn as the very first in a 
sequence.  Something that's unlikely to happen for calls and jumps,
but needn't be special cased away.

Ok with those changes, assuming they bootstrap.



r~



More information about the Gcc-patches mailing list