public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bruno at clisp dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/112708] "gcc -fsanitize=address" produces wrong debug info for variables in function prologue
Date: Sat, 25 Nov 2023 06:22:51 +0000	[thread overview]
Message-ID: <bug-112708-4-OmsvwCIvym@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112708-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Bruno Haible <bruno at clisp dot org> ---
(In reply to Andrew Pinski from comment #3)
> Also did you add -fvar-tracking-assignments ?

No, I haven't. I have specified CFLAGS=-ggdb, indicating that
  - I don't care about the optimization level,
  - but I want the ability to debug with gdb. And that includes not being
disturbed and alarmed by wrong values of variables. (I wouldn't mind if
single-stepping would not stop at the function entry directly, only at the
first statement of the function. Then I would not have the opportunity to do
'print context' at the wrong moment.)

Which passes and internal machinery GCC needs in order to fulfil these goals,
should be GCC internal. In other words, I specify '-ggdb' and expect GCC to do
the rest.

Additionally, Jakub Jelinek writes in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102523#c2 :
! sometimes -O0 -g is debuggable much better than -Og -g, sometimes the other
way around.
Which is not really a recommendation to use this option on a general basis.

  parent reply	other threads:[~2023-11-25  6:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-25  4:35 [Bug sanitizer/112708] New: " bruno at clisp dot org
2023-11-25  4:54 ` [Bug sanitizer/112708] " pinskia at gcc dot gnu.org
2023-11-25  4:54 ` pinskia at gcc dot gnu.org
2023-11-25  4:56 ` pinskia at gcc dot gnu.org
2023-11-25  5:50 ` bruno at clisp dot org
2023-11-25  6:22 ` bruno at clisp dot org [this message]
2023-11-26  2:08 ` bruno at clisp dot org
2023-11-27  8:04 ` rguenth at gcc dot gnu.org
2023-11-27 10:07 ` bruno at clisp dot org
2023-11-27 10:29 ` jakub at gcc dot gnu.org
2023-11-28  1:03 ` bruno at clisp dot 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-112708-4-OmsvwCIvym@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: link
Be 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).