21 msgDynamically linking against GMP and MPFR
2 msgPR for multilib build problems?
2 msggcc 4.2 breaks debugging anonymous namespace
3 msgnamespace lookup
1 msggcc-4.2.0 for sparc64-linux and cygwin
1 msgGCC 3.4.6 to GCC 4.1.1 migration

Function prologue - Debug info for frame relate...
\ Rohit Arul Raj (24 May 2007)
. \ Ian Lance Taylor (24 May 2007)

1 msggcc-4.2-20070523 is now available
1 msgDataflow miscompiles soft-fp/floatuntitf.c on x...
2 msgThe best testsuite result on Linux/x86-64 in mo...
2 msgBOOT_CFLAGS and gcc trunk
1 msgDF branch benchmarking on SPEC2000
9 msggcc-current: badly worded warning?
1 msg[4.2.0] Can't bootstrap for cywin: bootstrap co...
5 msghttp://gcc.gnu.org/svn.html have a error.
2 msgGCC, Wei Chen wants to chat
1 msggcc-4.1-20070521 is now available
29 msgVolunteer for bug summaries?
4 msghelp writing gcc code
4 msgProblem when using optimization on aix 5.2 and ...
Subject:Function prologue - Debug info for frame related instruction
Group:Gcc
From:Rohit Arul Raj
Date:24 May 2007


Hi all,

I am having some issues while generating debug info for frame related
instructions in fuction_prologue (for GCC 4.1.1) for a private target.
(fr30 & cris backend also showed similiar error while dumping the
debug info).

For my target, while generating the stack frame for local variable, if
the frame size is 2 ^ 17, i have to use a scratch register. In the
scratch register, i can't move immediate values greater the 2 ^ 16.

So to allocate the stack frame, my insn were like this:

insn = emit_insn (gen_movsi ( scratch_reg, GEN_INT (frame_size & 0xffff)));
RTX_FRAME_RELATED_P (insn) = 1; ---------> (1)

insn = emit_insn (gen_hi_word (scratch_reg, scratch_reg,
GEN_INT(frame_size >> 16)));
RTX_FRAME_RELATED_P (insn) = 1; ----------> (2)

insn = emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx,
scratch_reg));
RTX_FRAME_RELATED_P (insn) = 1; -----------> (3)

When the above mentioned code was invoked, i got the following error
"internal compiler error: in dwarf2out_frame_debug_expr, at dwarf2out.c:1714"

As a workaround, i generated a reg note (similiar to alpha & sparc)
for the DWARF code to look through

emit_insn (gen_movsi ( scratch_reg, GEN_INT (frame_size & 0xffff)));
emit_insn (gen_hi_word (scratch_reg, scratch_reg, GEN_INT(frame_size >> 16)));
insn = emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx,
scratch_reg));

RTX_FRAME_RELATED_P (insn) = 1;
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
gen_rtx_PLUS (Pmode, stack_pointer_rtx,
GEN_INT (- frame_size))),
REG_NOTES (insn));

If i do this, my compilation is getting through, But when i try to
dump the debug_info through readelf (fr30-elf-readelf --debug-dump
a.out), i am getting the following error

"readelf: Error: Location lists in .debug_info section aren't in
ascending order!"

This is the sample test program:
int main()
{
int temp;
char new[1<<17];
return 0;
}

1. Is the REG NOTE provided for the dwarf code proper?
2. What is the reason for readelf error?

Regards,
Rohit


© 2004-2008 readlist.com