public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/106399] New: Wrong debug info for function with nested function under O0
@ 2022-07-22  5:33 liyd2021 at gmail dot com
  2022-07-22  7:19 ` [Bug debug/106399] [10/11/12/13 Regression] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: liyd2021 at gmail dot com @ 2022-07-22  5:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106399

            Bug ID: 106399
           Summary: Wrong debug info for function with nested function
                    under O0
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liyd2021 at gmail dot com
  Target Milestone: ---

Affected versions:  gcc 11.1.0 (Ubuntu 20.04.2), since gcc 9

The debugger print `a` with a uninitialized value while `a` should be 3 at the
breakpoint.

(terminal) $ cat a.c && gcc -g -OO a.c
int foo(int a)
{
        int a2()
        {
                return a * a;
        }
        return a2();
}

int main()
{
        return foo(3) - 9;
}

--------------------

(terminal) $ gdb a.out
(gdb) b foo
Breakpoint 1 at 0x401188: file a.c, line 1.
(gdb) r
Breakpoint 1, foo (a=0) at a.c:1   <- **BUG**: a should be 3
1       int foo(int a)

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

end of thread, other threads:[~2023-07-07 10:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22  5:33 [Bug debug/106399] New: Wrong debug info for function with nested function under O0 liyd2021 at gmail dot com
2022-07-22  7:19 ` [Bug debug/106399] [10/11/12/13 Regression] " rguenth at gcc dot gnu.org
2022-07-22 10:10 ` [Bug debug/106399] [10/11/12/13 Regression] Wrong debug info for function with nested function under O0 since r9-1284-gd70ba0c10dec6968 marxin at gcc dot gnu.org
2022-07-22 12:31 ` ebotcazou at gcc dot gnu.org
2022-07-28 17:47 ` jakub at gcc dot gnu.org
2022-07-29  8:44 ` ebotcazou at gcc dot gnu.org
2022-07-29  8:45 ` ebotcazou at gcc dot gnu.org
2023-07-07 10:43 ` [Bug debug/106399] [11/12/13/14 " rguenth 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).