public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/43092]  New: [4.5 Regression] Wrong debuginfo with VTA and -fomit-frame-pointer/-mno-accumulate-outgoing-args
@ 2010-02-16 13:25 jakub at gcc dot gnu dot org
  2010-02-16 13:28 ` [Bug debug/43092] " jakub at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-02-16 13:25 UTC (permalink / raw)
  To: gcc-bugs

/* { dg-do run } */
/* { dg-options "-O2 -march=i586 -dA -g -fomit-frame-pointer" { target { {
i?86-*-* x86_64-*-* } && ilp32 } } } */

void __attribute__((noinline))
bar (int *p)
{
  (*p)++;
  asm volatile ("" : "=r" (*p) : "0" (*p) : "memory");
}

void __attribute__((noinline))
baz (int a, int b, int c, int d, int e, int f)
{
  asm volatile ("" : : "r" (a + b + c + d + e + f) : "memory");
}

int __attribute__((noinline))
foo (int x)
{
  int y;
  y = 5;
  bar (&y);
  baz (0, 1, 2, 3, 4, 5);
  bar (&x);
  y++;
  baz (1, 2, 3, 4, 5, 6);
  bar (&y);
  return x + y;
}

int
main ()
{
  if (foo (17) != 8 + 18)
    __builtin_abort ();
  return 0;
}

has wrong debuginfo for variable y - (mem (sp + offset)) live across several sp
adjustments.  In the debugger inside foo when using nexti and printing y after
each nexti, it first starts as <optimized out> (expected), then y = 5 is
executed and it prints 5, but then sp is adjusted and it prints garbage because
sp changed.

I believe we should be de-eliminating stack_pointer_rtx resp.
hard_frame_pointer_rtx based MEMs in var-tracking generated notes back to
arg_pointer_rtx / frame_pointer_rtx based notes when they aren't meant to
change whenever sp resp. fp changes.

On the http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43051#c1 testcase this
doesn't show up as wrong debug, but just inefficient location list (LVL1
through LVL2 the argument is fbreg 0, while from LVL2 to LVL12 it is breg5 8
when both
locations are actually the same memory.  There is also the additional problem
that we leave out the epilogue ret insn, as if the parameter wasn't defined at
that spot.


-- 
           Summary: [4.5 Regression] Wrong debuginfo with VTA and -fomit-
                    frame-pointer/-mno-accumulate-outgoing-args
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-debug
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
GCC target triplet: i686-linux


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


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <bug-43092-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-02-03  6:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-16 13:25 [Bug debug/43092] New: [4.5 Regression] Wrong debuginfo with VTA and -fomit-frame-pointer/-mno-accumulate-outgoing-args jakub at gcc dot gnu dot org
2010-02-16 13:28 ` [Bug debug/43092] " jakub at gcc dot gnu dot org
2010-02-16 15:17 ` jakub at gcc dot gnu dot org
2010-02-16 16:27 ` jakub at gcc dot gnu dot org
2010-02-16 19:45 ` jakub at gcc dot gnu dot org
2010-03-16 10:52 ` jakub at gcc dot gnu dot org
2010-03-16 10:53 ` jakub at gcc dot gnu dot org
     [not found] <bug-43092-4@http.gcc.gnu.org/bugzilla/>
2011-02-03  6:04 ` aoliva at gcc dot gnu.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).