Re: how to set some value at a memory location in stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vaibhav Shrimali <vaibhav.shrimali@xxxxxxxxx> writes:

> Thanks for all your help so far. I now think I am closer to my goal.
> In order to execute :
> XOR [EBP+4], [EBP]
> after executing :
> PUSH EBP
>
> in the prologue, I need to use : emit_insn (gen_xorsi3 (DESTREG, SRC1, SRC2));
> So I checked and I can generate a register such that:
> rtx ebp_reg = gen_rtx_REG(Pmode, BP_REG);
> this would be a hard register.
> rtx ebp_plus = gen_rtx_PLUS(Pmode, ebp_reg, 4);
>
> so now executing :-
>
> emit_insn (gen_xorsi3 (ebp_plus, ebp_plus, ebp_reg));
>
> I dont know if ebp_plus would be converted to [XOR+4] or not, although
> it is derived from the hard register ebp_reg.
>
> If I am wrong in this approach, please correct me.

At some point you have to try it and see what happens.  The dump files
will show you the generated RTL.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux