public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/45103]  New: DW_OP_reg* has too large valid range for noreturn funcs
@ 2010-07-28  9:54 jan dot kratochvil at redhat dot com
  2010-07-28  9:55 ` [Bug debug/45103] " jan dot kratochvil at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-07-28  9:54 UTC (permalink / raw)
  To: gcc-bugs

Use -g -O2.

DW_OP_reg5 is there valid for each PC, despite there si a `call' and reg5 is
caller-saved register.  Its value therefore gets corrupted in the callee.

FAIL all these:
gcc (GCC) 4.6.0 20100724 (experimental)
gcc (GCC) 4.5.1 20100728 (prerelease)
gcc (GCC) 4.4.5 20100724 (prerelease)
gcc-4.4.4-10.fc13.x86_64
GNU gdb (GDB) 7.2.50.20100724-cvs

#0  breakat (q=0) at 1.c:7
#1  0x000000000040053b in f (a1=<value optimized out>, a2=2, a3=3, a4=4, a5=5,
a6=6, a7=7) at 2.c:6
#2  0x00000000004004fc in g (x=0) at 1.c:14
                             ^^^ x=10 here, it should be <value optimized out>
#3  0x000000000040051e in main () at 2.c:14

==> 1.c <==
#include <stdlib.h>

extern __attribute__((noreturn)) void f (long a1, long a2, long a3, long a4,
long a5, long a6, long a7);

__attribute__((noreturn)) void
breakat (long q)
{
  exit (0);
}

__attribute__((noinline)) void
g (long x)
{
  f (x, 2, 3, 4, 5, 6, 7);
}

==> 2.c <==
extern __attribute__((noreturn)) void breakat (long q);

__attribute__((noreturn)) void
f (long a1, long a2, long a3, long a4, long a5, long a6, long a7)
{
  breakat (0);
}

extern __attribute__((noinline)) void g (long x);

int
main (void)
{
  g (10);
  return 0;
}


-- 
           Summary: DW_OP_reg* has too large valid range for noreturn funcs
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jan dot kratochvil at redhat dot com
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug debug/45103] DW_OP_reg* has too large valid range for noreturn funcs
  2010-07-28  9:54 [Bug debug/45103] New: DW_OP_reg* has too large valid range for noreturn funcs jan dot kratochvil at redhat dot com
@ 2010-07-28  9:55 ` jan dot kratochvil at redhat dot com
  2010-07-28 10:03 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-07-28  9:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jan dot kratochvil at redhat dot com  2010-07-28 09:54 -------
Created an attachment (id=21331)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21331&action=view)
.s files for x86_64-unknown-linux-gnu.

GDB bug (probably invalid):
http://sourceware.org/bugzilla/show_bug.cgi?id=11838


-- 


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


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

* [Bug debug/45103] DW_OP_reg* has too large valid range for noreturn funcs
  2010-07-28  9:54 [Bug debug/45103] New: DW_OP_reg* has too large valid range for noreturn funcs jan dot kratochvil at redhat dot com
  2010-07-28  9:55 ` [Bug debug/45103] " jan dot kratochvil at redhat dot com
@ 2010-07-28 10:03 ` jakub at gcc dot gnu dot org
  2010-07-28 17:00 ` jakub at gcc dot gnu dot org
  2010-09-07 22:46 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-07-28 10:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2010-07-28 10:03 -------
Created an attachment (id=21332)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21332&action=view)
gcc46-pr45103.patch

For noreturn calls that end the function we were ignoring even
NOTE_DURING_CALL_P notes, thinking they don't affect any instructions.
While they don't affect any instructions in the current function, they affect
instructions in the called function.


-- 

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                     |
             Status|UNCONFIRMED                 |ASSIGNED


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


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

* [Bug debug/45103] DW_OP_reg* has too large valid range for noreturn funcs
  2010-07-28  9:54 [Bug debug/45103] New: DW_OP_reg* has too large valid range for noreturn funcs jan dot kratochvil at redhat dot com
  2010-07-28  9:55 ` [Bug debug/45103] " jan dot kratochvil at redhat dot com
  2010-07-28 10:03 ` jakub at gcc dot gnu dot org
@ 2010-07-28 17:00 ` jakub at gcc dot gnu dot org
  2010-09-07 22:46 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-07-28 17:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2010-07-28 17:00 -------
Subject: Bug 45103

Author: jakub
Date: Wed Jul 28 17:00:06 2010
New Revision: 162646

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162646
Log:
        PR debug/45103
        * dwarf2out.c (dwarf2out_var_location): Always consider
        NOTE_DURING_CALL_P notes, even when not followed by real instructions.

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


-- 


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


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

* [Bug debug/45103] DW_OP_reg* has too large valid range for noreturn funcs
  2010-07-28  9:54 [Bug debug/45103] New: DW_OP_reg* has too large valid range for noreturn funcs jan dot kratochvil at redhat dot com
                   ` (2 preceding siblings ...)
  2010-07-28 17:00 ` jakub at gcc dot gnu dot org
@ 2010-09-07 22:46 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-09-07 22:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2010-09-07 22:46 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2010-09-07 22:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-28  9:54 [Bug debug/45103] New: DW_OP_reg* has too large valid range for noreturn funcs jan dot kratochvil at redhat dot com
2010-07-28  9:55 ` [Bug debug/45103] " jan dot kratochvil at redhat dot com
2010-07-28 10:03 ` jakub at gcc dot gnu dot org
2010-07-28 17:00 ` jakub at gcc dot gnu dot org
2010-09-07 22:46 ` jakub 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).