protect label from being optimized

Joern Rennecke joernr@arc.com
Fri Apr 18 15:45:00 GMT 2008


> Kunal Parmar <kunalparmar@gmail.com> writes:
> 
> > Is this correct :
> >        ret_label = gen_label_rtx ();
> >        emit_move_insn (gen_rtx_REG (HImode, 7),
> >                                    gen_rtx_LABEL_REF (VOIDmode,
> > ret_label));
> >        emit_call_insn (gen_brc_call_simulate (addr, args_size));
> >        emit_label (ret_label);

Ian Lance Taylor:

> It looks plausible.

It looks like a mis-optimization waiting to happen.
Nothing tells the compiler that it can't move an instruction
bewteen the call and the label.
You are better off generating the label or immediately emitting the
assembly for the label when you emit the assembly code for the call.



More information about the Gcc mailing list