GCC 3.3 Prelease broken on s390

Richard Henderson rth@redhat.com
Tue May 6 23:19:00 GMT 2003


On Wed, May 07, 2003 at 12:28:02AM +0200, Ulrich Weigand wrote:
> Where?  Except for a gdb problem where it incorrectly
> assumed that the DWARF-2 CFA and the DWARF-2 frame_base
> must be the same (this has been fixed in the meantime),
> we've never seen any problems ...

I see, because the existing code that installed a new stack pointer value
did it by differential.  I.e. the difference between one stack frame and
another, which is the same assuming the bias is constant.

Which begs the question of why my patch affects anything, because we're
*still* dealing with a difference.  This I need to understand.  Can you
debug what's going on?

(Though there was a follow-up patch for mainline that *does* assume that
the stack pointer is really really the CFA.  This allows interrupt frames
to be encoded much more efficiently (and in a way that's actually
maintainable by hand) than without the patch.)

> Our choice of CFA has remained unchanged since 2.95.x...

An unfortunate mistake.  :-(

A more "correct" typical frame would be

.LSCIE0:
        .4byte  0xffffffff      # CIE Identifier Tag
        .byte   0x1     # CIE Version
        .ascii "\0"     # CIE Augmentation
        .byte   0x1     # uleb128 0x1; CIE Code Alignment Factor
        .byte   0x7c    # sleb128 -4; CIE Data Alignment Factor
        .byte   0xe     # CIE RA Column
        .byte   0xc     # DW_CFA_def_cfa
        .byte   0xf     # uleb128 0xf
        .byte   0x0     # uleb128 0x0
        .align  4
.LECIE0:
.LSFDE0:
        .4byte  .LEFDE0-.LASFDE0        # FDE Length
.LASFDE0:
        .4byte  .Lframe0        # FDE CIE offset
        .4byte  .LFB3   # FDE initial location
        .4byte  .LFE3-.LFB3     # FDE address range
        .byte   0x4     # DW_CFA_advance_loc4
        .4byte  .LCFI0-.LFB3
        .byte   0x11    # DW_CFA_offset_extended_sf
        .byte   0xf     # uleb128 0xf
        .byte   0x71    # sleb128 -15
        .byte   0x11    # DW_CFA_offset_extended_sf
        .byte   0xe     # uleb128 0xe
        .byte   0x72    # sleb128 -14
        .byte   0x11    # DW_CFA_offset_extended_sf
        .byte   0xd     # uleb128 0xd
        .byte   0x73    # sleb128 -13
        .byte   0x4     # DW_CFA_advance_loc4
        .4byte  .LCFI1-.LCFI0
        .byte   0xe     # DW_CFA_def_cfa_offset
        .byte   0x60    # uleb128 0x60
        .align  4
.LEFDE0:

As seen with

-#define INCOMING_FRAME_SP_OFFSET STACK_POINTER_OFFSET
+#define INCOMING_FRAME_SP_OFFSET       0
+#define ARG_POINTER_CFA_OFFSET(FNDECL) (-STACK_POINTER_OFFSET)

If we really can't declare this a bug, and fix it, then...
I dunno, perhaps some new target macro can work around this.


r~



More information about the Gcc mailing list