This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: protect label from being optimized


Kunal Parmar <kunalparmar@gmail.com> writes:

> I am working on porting GCC to a new RISC architecture. The ISA does
> not have a "Jump and Link Register" instruction. So I am simulating
> one by replacing
>          jal [reg]
> by
>          load ra, Lret
>          jr reg
> Lret:
>
> in RTL.
> But my return label is getting optimized away. Could you please tell
> me how to avoid this.

Make sure the load label instruction is using a LABEL_REF.  Look at
sh.md for various examples.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]