protect label from being optimized

Jim Wilson wilson@tuliptree.org
Fri Apr 18 19:07:00 GMT 2008


Kunal Parmar wrote:
>  >> But my return label is getting optimized away. Could you please tell
>  >> me how to avoid this.

You may also need to add a (USE (REG RA)) to the call pattern.  Gcc will 
see that you set a register to the value of the return label, but it 
won't see any code that uses that register, so it will optimize away 
both the load and the label.  To prevent this, you need to add an 
explicit use of that register to the call insn pattern.

Jim



More information about the Gcc mailing list