public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/21946] New: Invalid DWARF2 debug info emitted
@ 2005-06-07  8:40 jakub at gcc dot gnu dot org
  2005-06-07  8:41 ` [Bug debug/21946] " jakub at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-06-07  8:40 UTC (permalink / raw)
  To: gcc-bugs

On ppc32:
/* { dg-options "-m32 -O2 -g" } */
extern int m;
struct A { unsigned char a; };
struct B { void *b; };
extern struct B *fn (int x);
struct C { struct C *c; };
static unsigned char *d;
typedef int (*T) (struct C *, void *);
struct C *foo (struct C *, T, void *);
int fx (struct C *, void *);

static struct C *
bar (struct C *x, unsigned char y, unsigned char z)
{
  unsigned char v[2] = { y, z };
  return foo (x, fx, v);
}

struct C *
baz (struct A *x, long long int y)
{
  struct B *b;
  struct C *c;
  long long int z;

  if (!(m == 4 || m == 2))
    return 0;
  z = x->a;
  b = fn (z);
  if (!b)
    return 0;
  c = (struct C *) b->b;
  if (!c)
    return 0;
  if (m == 2 && z >= 240)
    z -= 240;
  else if (d)
    z = d[z];
  if (z == 255)
    return 0;
  return bar (c->c, z, y);
}

emits:
emits in one range for the y variable (DImode, i.e. 2 hard registers):
        .4byte  .LVL0-.Ltext0    # Location list begin address (*.LLST2)
        .4byte  .LVL2-.Ltext0    # Location list end address (*.LLST2)
        .2byte  0x6      # Location expression size
        .byte   0x55     # DW_OP_reg5
        .byte   0x93     # DW_OP_piece
        .byte   0x4      # uleb128 0x4
        .byte   0x56     # DW_OP_reg6
        .byte   0x93     # DW_OP_piece
        .byte   0x4      # uleb128 0x4
        .4byte  .LVL2-.Ltext0    # Location list begin address (*.LLST2)
        .4byte  .LVL3-.Ltext0    # Location list end address (*.LLST2)
        .2byte  0xb      # Location expression size
        .byte   0x55     # DW_OP_reg5
        .byte   0x93     # DW_OP_piece
        .byte   0x4      # uleb128 0x4
        .byte   0x56     # DW_OP_reg6
        .byte   0x93     # DW_OP_piece
        .byte   0x4      # uleb128 0x4
        .byte   0x93     # DW_OP_piece
        .byte   0x8      # uleb128 0x8
        .byte   0x56     # DW_OP_reg6
        .byte   0x93     # DW_OP_piece
        .byte   0x4      # uleb128 0x4
...

Similar problems occur even on little-endian targets, although less often:
           0xffffffff8014ebb0..0xffffffff8014ebc2 [   0] fbreg 160
                                                  [   3] piece 4
                                                  [   5] fbreg 164
                                                  [   8] piece 4
           0xffffffff8014ebc2..0xffffffff8014ebc4 [   0] fbreg 160
           0xffffffff8014ebc4..0xffffffff8014ebd6 [   0] fbreg 160
                                                  [   3] piece 8        <-- BAD
                                                  [   5] fbreg 164
                                                  [   8] piece 4
(64-bit variable).

Not a regression, as -fvar-tracking is new in GCC 4.0, though one might say
that before we at least were not generating invalid debug info.

-- 
           Summary: Invalid DWARF2 debug info emitted
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: jakub at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: ppc-linux, x86_64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21946


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-07-09 15:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-07  8:40 [Bug debug/21946] New: Invalid DWARF2 debug info emitted jakub at gcc dot gnu dot org
2005-06-07  8:41 ` [Bug debug/21946] " jakub at gcc dot gnu dot org
2005-06-07 10:17 ` cvs-commit at gcc dot gnu dot org
2005-06-07 15:20 ` [Bug debug/21946] [4.0 Regression] " pinskia at gcc dot gnu dot org
2005-06-08  7:49 ` cvs-commit at gcc dot gnu dot org
2005-07-08  1:34 ` mmitchel at gcc dot gnu dot org
2005-07-09  8:46 ` cvs-commit at gcc dot gnu dot org
2005-07-09 15:28 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).