INSN_SCOPE + CODE_LABEL (was Re: emit-rtl.c fix)

Jan Hubicka jh@suse.cz
Wed Jun 12 01:53:00 GMT 2002


>    From: law@redhat.com
>    Date: Tue, 11 Jun 2002 17:55:18 -0600
> 
>    Minor fall-out from the SEQUENCE patch.  Basically we started looking at the
>    wrong insns after performing a split.
> 
> Good catch Jeff.
> 
> We still have a problem when using RTL checking, as spotted
> by Andreas.  Basically the emit_*_scope() functions crash
> on i386 because a splitter emits CODE_LABEL rtl and trying to
> do an INSN_SCOPE () on that will get a checker failure.
> 
> This problem is independant of my changes.  I think it wasn't spotted
> earlier because of the original bug in emit_*_scope().  That bug was
> that it would not process the last instruction properly.

Ooops..
> 
> Jan, why are CODE_LABELs and NOTEs special and lack the scoping
> member?  Regardless, could you fix the emit_*_scope() things to handle
> CODE_LABEL and NOTE rtl properly wrt. setting the INSN_SCOPE?
> Since splitters can emit NOTEs and CODE_LABELs legitimately, this
> must be handled.
> 
> Can splitters emit BARRIER rtl?  That would be another case...

The INSN_SCOPE should be called only on INSN_P instructions.
The notes/labels/barriers are not real instructions and thus they have
no scope.  I've omitted it to save some memory, it is possible to record
the information there as well and ignore it later.

Splitter is allowed to emit barrier, since it is allowed to emit new
jumpos inside.

I have to leave for a hour, I can commit patch to fix the problem then.
> 
> This brings up another issue.  That is "INSN_P".  When I first started
> using it in my sequence patches I thought this meant "is this
> something which may be found in the insn chain", and this is not what
> it means.  What it means is "RTX class 'i'" which does not include
> NOTE, CODE_LABEL, and BARRIER expressions which are class 'x'.

Yes, insn_p is means exactly that the entity is isntruction
(insn/call/jump), something that goes into the object file.

Honza



More information about the Gcc-patches mailing list