how to set some value at a memory location in stack

Vaibhav Shrimali
Fri Apr 16 05:44:00 GMT 2010

Hey Ian,
I have been executing the code all this time. But apparently it was
generating segmentation fault error.
I configured the compiler with --disable-libssp option to disable the
stack protector. Also I modified the hard frame pointer offset in the
compute_frame_layout() method.
But still it is showing segmentation fault.

On Thu, Apr 15, 2010 at 7:41 PM, Ian Lance Taylor <> wrote:
> Vaibhav Shrimali <> 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 :
>> 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

Vaibhav Shrimali

More information about the Gcc-help mailing list