Need help in solving error generated while building compiler (stage-2)

Priyanka Dudani
Mon Jun 7 17:23:00 GMT 2010


I need to encrypt return address when calling a function by modifying
prologue and epilogue of the compiler. I am trying to do the same by
XORing return address with EBP register value.
Here is the code i have written in ix86_expand_prologue() method in i386.c file.

if (frame_pointer_needed)
      insn = emit_insn (gen_push (hard_frame_pointer_rtx));
      RTX_FRAME_RELATED_P (insn) = 1;
      insn = emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx);
      RTX_FRAME_RELATED_P (insn) = 1;

                ebp_plus = gen_rtx_REG(Pmode, CX_REG);
                ebp = gen_rtx_REG(Pmode, BP_REG);
plus_constant(hard_frame_pointer_rtx, 4));
                if (TARGET_64BIT)
                insn = emit_insn(gen_xordi3(ebp_plus, ebp_plus,
                 insn = emit_insn(gen_xorsi3(ebp_plus, ebp_plus,

Similar code in ix86_expand_epilogue() method.

While building the compiler, it gets built till stage-1 successfully.
But gives the following error at the end of stage-2

../../gcc-4.3.3/gcc/config/i386/ : error :
'TARGET_USE_CCGOCMODE_FIOP' undeclared here (not in a function)

The line 16349 in file, at which error occurs has the
following code written

16350  "* return which_alternative ? \"#\" : output_387_binary_op
(insn, operands);"

The error is related to the mode of the compiler but i am not able to
figure out what is causing this error.

Please tell me what can be the cause of the error or where am i going wrong ?
Please help me with this.

Thanking You,
Priyanka Dudani

More information about the Gcc-help mailing list