This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix nested functions
> Jan Hubicka wrote:
>
> > > The predicate *does* not allow a label_ref here, but it is never checked
> > > because the insn isn't re-recognized any longer after your change.
> > Is it? I tought that there are two paths - one emitting and other
> > validating the change.
>
> Well, first the insn is simply changed in place:
>
> /* We don't normally have an insn matching (set (pc) (pc)), so
> check for this separately here. We will delete such an
> insn below.
>
> For other cases such as a table jump or conditional jump
> where we know the ultimate target, go ahead and replace the
> operand. While that may not make a valid insn, we will
> reemit the jump below (and also insert any necessary
> barriers). */
> if (n_sets == 1 && dest == pc_rtx
> && (trial == pc_rtx
> || (GET_CODE (trial) == LABEL_REF
> && ! condjump_p (insn))))
I see, adding "&& !LABEL_REF_NONLOCAL_P (trial)" would probably help
here, I will test the change tomorrow.
> {
> SET_SRC (sets[i].rtl) = trial;
> cse_jumps_altered = 1;
> break;
> }
>
> and later it is reemitted, which is supposed to heal all broken insns.
> Except you switched off the reemitting ;-)
>
> > In addition to this we have LABEL_REF_NONLOCAL_P flag and the LABEL_REF
> > is reconstructed.
>
> Hmm. Is this completely redundant, or what's the point of having
> to distinct mechanisms?
the nonlocal gotos are usually indirect, so one mechanizm is marking the
indirect goto while the other is marking the actual label when it is
load to register, I think.
Thanks,
Honza