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:
> 
> > 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.


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