public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/40596]  New: [4.5 regression] Bad debug info for local variables on i386.
@ 2009-06-29 21:02 ppluzhnikov at google dot com
  2009-06-29 21:51 ` [Bug debug/40596] " hjl dot tools at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2009-06-29 21:02 UTC (permalink / raw)
  To: gcc-bugs

The test case from bug 40012 still fails in current mainline @149059 in 32-bit
mode:

--- cut ---
struct list_s {
  struct list_s* next;
};

typedef struct list_s list;

void f1(void*, list*);
int
f0(void* a,
   void* b,
   void* c,
   list* d)
{
    list* problem;
    for(problem = d; problem; problem = problem->next) {
      int variable = 0;
      f1(c, problem);
    }
    return (0);
}

int main()
{
  list a3 = { 0 };
  f0(0, 0, 0, &a3);
  return 0;
}

void f1(void*a, list*b) { }
--- cut ---

gcc-svn-install-149059/bin/gcc -g gcc-pr40012-test.c -m32

gdb -q a.out
(gdb) b main
Breakpoint 1 at 0x80483d9: file gcc-pr40012-test.c, line 24.
(gdb) r

Breakpoint 1, main () at gcc-pr40012-test.c:24
24        list a3 = { 0 };
(gdb) n
25        f0(0, 0, 0, &a3);
(gdb) p &a3
$1 = (list *) 0xffffccb4
(gdb) s
f0 (a=0x0, b=0x0, c=0x0, d=0xffffcc8c) at gcc-pr40012-test.c:15
15          for(problem = d; problem; problem = problem->next) {

Note mismatch between where GDB thinks &a3 is and the actual address.
[AFAICT, this is currently causing 300+ failures in the GDB test suite.]


-- 
           Summary: [4.5 regression] Bad debug info for local variables on
                    i386.
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ppluzhnikov at google dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug debug/40596] [4.5 regression] Bad debug info for local variables on i386.
  2009-06-29 21:02 [Bug debug/40596] New: [4.5 regression] Bad debug info for local variables on i386 ppluzhnikov at google dot com
@ 2009-06-29 21:51 ` hjl dot tools at gmail dot com
  2009-06-29 21:54 ` hjl dot tools at gmail dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-06-29 21:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from hjl dot tools at gmail dot com  2009-06-29 21:51 -------
This is caused by revision 147995:

http://gcc.gnu.org/ml/gcc-cvs/2009-05/msg00974.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-06-29 21:51:45
               date|                            |


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


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

* [Bug debug/40596] [4.5 regression] Bad debug info for local variables on i386.
  2009-06-29 21:02 [Bug debug/40596] New: [4.5 regression] Bad debug info for local variables on i386 ppluzhnikov at google dot com
  2009-06-29 21:51 ` [Bug debug/40596] " hjl dot tools at gmail dot com
@ 2009-06-29 21:54 ` hjl dot tools at gmail dot com
  2009-06-29 22:36 ` ppluzhnikov at google dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-06-29 21:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hjl dot tools at gmail dot com  2009-06-29 21:54 -------
This is related to PR 40304.


-- 


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


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

* [Bug debug/40596] [4.5 regression] Bad debug info for local variables on i386.
  2009-06-29 21:02 [Bug debug/40596] New: [4.5 regression] Bad debug info for local variables on i386 ppluzhnikov at google dot com
  2009-06-29 21:51 ` [Bug debug/40596] " hjl dot tools at gmail dot com
  2009-06-29 21:54 ` hjl dot tools at gmail dot com
@ 2009-06-29 22:36 ` ppluzhnikov at google dot com
  2009-06-29 23:44 ` jakub at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2009-06-29 22:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ppluzhnikov at google dot com  2009-06-29 22:36 -------
Confirmed working correctly @147994.


-- 


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


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

* [Bug debug/40596] [4.5 regression] Bad debug info for local variables on i386.
  2009-06-29 21:02 [Bug debug/40596] New: [4.5 regression] Bad debug info for local variables on i386 ppluzhnikov at google dot com
                   ` (2 preceding siblings ...)
  2009-06-29 22:36 ` ppluzhnikov at google dot com
@ 2009-06-29 23:44 ` jakub at gcc dot gnu dot org
  2009-07-02 11:31 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-06-29 23:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2009-06-29 23:43 -------
The problem seems to be in based_loc_descriptor:
          /* If drap register is used to align stack, use frame
             pointer + offset to access stack variables.  If stack
             is aligned without drap, use stack pointer + offset to
             access stack variables.  */
          if (crtl->stack_realign_tried
              && cfa.reg == HARD_FRAME_POINTER_REGNUM
              && reg == frame_pointer_rtx)
            {
              int base_reg
                = DWARF_FRAME_REGNUM (cfa.indirect
                                      ? HARD_FRAME_POINTER_REGNUM
                                      : STACK_POINTER_REGNUM);
              return new_reg_loc_descr (base_reg, offset);
            }
I don't see how it can be correct to look at cfa variable content in here, when
scanning through the function is well over and thus cfa contains whatever was
the CFA on the last emitted instruction.  Before epilogue unwinding this
happened to work, because cfa happened to stay at what was in the middle of the
function.


-- 


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


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

* [Bug debug/40596] [4.5 regression] Bad debug info for local variables on i386.
  2009-06-29 21:02 [Bug debug/40596] New: [4.5 regression] Bad debug info for local variables on i386 ppluzhnikov at google dot com
                   ` (3 preceding siblings ...)
  2009-06-29 23:44 ` jakub at gcc dot gnu dot org
@ 2009-07-02 11:31 ` jakub at gcc dot gnu dot org
  2009-07-04 17:19 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-07-02 11:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2009-07-02 11:30 -------
Fix posted: http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00091.html


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2009-
                   |                            |07/msg00091.html
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-06-29 21:51:45         |2009-07-02 11:30:53
               date|                            |


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


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

* [Bug debug/40596] [4.5 regression] Bad debug info for local variables on i386.
  2009-06-29 21:02 [Bug debug/40596] New: [4.5 regression] Bad debug info for local variables on i386 ppluzhnikov at google dot com
                   ` (4 preceding siblings ...)
  2009-07-02 11:31 ` jakub at gcc dot gnu dot org
@ 2009-07-04 17:19 ` jakub at gcc dot gnu dot org
  2009-07-15  7:27 ` steven at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-07-04 17:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2009-07-04 17:19 -------
Subject: Bug 40596

Author: jakub
Date: Sat Jul  4 17:19:26 2009
New Revision: 149235

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149235
Log:
        PR debug/40596
        * dwarf2out.c (based_loc_descr): For crtl->stack_realign_tried
        don't check cfa.reg.  Instead of cfa.indirect use
        fde && fde->drap_reg != INVALID_REGNUM test.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c


-- 


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


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

* [Bug debug/40596] [4.5 regression] Bad debug info for local variables on i386.
  2009-06-29 21:02 [Bug debug/40596] New: [4.5 regression] Bad debug info for local variables on i386 ppluzhnikov at google dot com
                   ` (5 preceding siblings ...)
  2009-07-04 17:19 ` jakub at gcc dot gnu dot org
@ 2009-07-15  7:27 ` steven at gcc dot gnu dot org
  2009-07-29 22:49 ` jsm28 at gcc dot gnu dot org
  2009-07-29 22:51 ` ppluzhnikov at google dot com
  8 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-07-15  7:27 UTC (permalink / raw)
  To: gcc-bugs



-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.0


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


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

* [Bug debug/40596] [4.5 regression] Bad debug info for local variables on i386.
  2009-06-29 21:02 [Bug debug/40596] New: [4.5 regression] Bad debug info for local variables on i386 ppluzhnikov at google dot com
                   ` (6 preceding siblings ...)
  2009-07-15  7:27 ` steven at gcc dot gnu dot org
@ 2009-07-29 22:49 ` jsm28 at gcc dot gnu dot org
  2009-07-29 22:51 ` ppluzhnikov at google dot com
  8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-07-29 22:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jsm28 at gcc dot gnu dot org  2009-07-29 22:48 -------
As I understand it this is fixed by the patch shown (r149235),
please reopen if not.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug debug/40596] [4.5 regression] Bad debug info for local variables on i386.
  2009-06-29 21:02 [Bug debug/40596] New: [4.5 regression] Bad debug info for local variables on i386 ppluzhnikov at google dot com
                   ` (7 preceding siblings ...)
  2009-07-29 22:49 ` jsm28 at gcc dot gnu dot org
@ 2009-07-29 22:51 ` ppluzhnikov at google dot com
  8 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2009-07-29 22:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ppluzhnikov at google dot com  2009-07-29 22:51 -------
Confirm: r149235 fixes the problem here :-)


-- 


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


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

end of thread, other threads:[~2009-07-29 22:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-29 21:02 [Bug debug/40596] New: [4.5 regression] Bad debug info for local variables on i386 ppluzhnikov at google dot com
2009-06-29 21:51 ` [Bug debug/40596] " hjl dot tools at gmail dot com
2009-06-29 21:54 ` hjl dot tools at gmail dot com
2009-06-29 22:36 ` ppluzhnikov at google dot com
2009-06-29 23:44 ` jakub at gcc dot gnu dot org
2009-07-02 11:31 ` jakub at gcc dot gnu dot org
2009-07-04 17:19 ` jakub at gcc dot gnu dot org
2009-07-15  7:27 ` steven at gcc dot gnu dot org
2009-07-29 22:49 ` jsm28 at gcc dot gnu dot org
2009-07-29 22:51 ` ppluzhnikov at google dot com

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).