public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "liyd2021 at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/106399] New: Wrong debug info for function with nested function under O0 Date: Fri, 22 Jul 2022 05:33:09 +0000 [thread overview] Message-ID: <bug-106399-4@http.gcc.gnu.org/bugzilla/> (raw) 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)
next reply other threads:[~2022-07-22 5:33 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-22 5:33 liyd2021 at gmail dot com [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-106399-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).