This is the mail archive of the gcc-bugs@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]

pb with frame notes from hppa_expand_prologue ?



Hello,

Using trunk sources, I saw your changes to get DWARF2 info on pa-linux and am
trying to get the same for pa-hpux, but hit a problem at O1/O2 that does not
seem to be hpux specific. I think I see what the problem is, but I might well
be mistaken, so am unsure how this should be fixed if the analysis below is
correct.

A bit of light would be welcome :)

Thanks in advance for your help,

Kind Regards,

Olivier

---

Basically, pa.c:3104 (in hppa_expand_prologue) reads :

   3104       if (merge_sp_adjust_with_store)
   3105         {
   3106           rtx delta = GEN_INT (-offset);
   3107           merge_sp_adjust_with_store = 0;
   3108           FRP (emit_insn (gen_post_store (stack_pointer_rtx,
   3109                                           gen_rtx_REG (word_mode, i),
   3110                                           delta)));
   3111         }

3108 builds a parallel and sets RTX_FRAME_RELATED_P to 1 for the parallel
only, which looks like :

parallel[ 
        (set (mem:SI (reg/f:SI 30 %r30) 0)
            (reg:SI 4 %r4))
        (set (reg/f:SI 30 %r30)
            (plus:SI (reg/f:SI 30 %r30)
                (const_int 64 [0x40])))
    ] )

Unfortunately, the dwarf2out circuitry only processes the first of these two
instructions, and the update of the stack pointer r30 goes unnoticed.

The following C code and a trick to force the FDEs to be output from
dwarf2out.c illustrates  :

--

int a, b, c, d, e, f;

void
bar (void)
{
}

void
foo (void)
{
  register int a1 = a;
  register int a2 = b;
  register int a3 = c;
  register int a4 = d;
  register int a5 = e;

  b = a1; 
  c = a2; 
  d = a3; 
  e = a4; 
  f = a5; 
  
  bar ();
}

--

$ gcc -v

Reading specs from /lisbon.b/hainque/BUILDS/pahpux-310/ins/lib/gcc-lib/hppa1.1-hp-hpux11.00/3.1/specs
Configured with: ../src/configure --prefix=/lisbon.b/hainque/BUILDS/pahpux-310/ins --host=hppa1.1-hp-hpux11.00 --disable-nls --enable-languages=c,ada --enable-threads --with-gnu-as

Thread model: single
gcc version 3.1 20010806 (experimental)

$ gcc -funwind-tables -O2 -S fr.c -o - -dA |& less ...

foo
        .PROC
        .CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=3
        .ENTRY
        ;# basic block 0
        addil LR'b-$global$,%r27
        stw %r2,-20(%r30)
L$CFI0000
        copy %r1,%r25
        addil LR'c-$global$,%r27
        copy %r1,%r28
        stwm %r4,64(%r30)            <==========
L$CFI0001

...

L$SCIE0001
        .word   0x0     ;# CIE Identifier Tag
        .byte   0x1     ;# CIE Version
        .ascii "\0"     ;# CIE Augmentation
        .uleb128 0x1    ;# CIE Code Alignment Factor
        .sleb128 4      ;# CIE Data Alignment Factor
        .byte   0x2     ;# CIE RA Column
        .byte   0xc     ;# DW_CFA_def_cfa
        .uleb128 0x1e
        .uleb128 0x0
        .align 4
L$ECIE0001
L$SFDE0001
        .word   L$EFDE0001-L$ASFDE0001  ;# FDE Length
L$ASFDE0001
        .word   L$ASFDE0001-__FRAME_BEGIN__     ;# FDE CIE offset
        .word   L$FB0001        ;# FDE initial location
        .word   L$FE0001-L$FB0001       ;# FDE address range
        .align 4
L$EFDE0001
L$SFDE0003
        .word   L$EFDE0003-L$ASFDE0003  ;# FDE Length
L$ASFDE0003
        .word   L$ASFDE0003-__FRAME_BEGIN__     ;# FDE CIE offset
        .word   L$FB0002        ;# FDE initial location
        .word   L$FE0002-L$FB0002       ;# FDE address range
        .byte   0x4     ;# DW_CFA_advance_loc4
        .word   L$CFI0001-L$FB0002
        .byte   0x84    ;# DW_CFA_offset, column 0x4
        .uleb128 0x0
        .byte   0x2f    ;# DW_CFA_GNU_negative_offset_extended
        .uleb128 0x2
        .uleb128 0x5
        .align 4

IIUC, the FDE indeed misses poper information to be able to compute the CFA
for the frame.




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