public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/61071] Compiling with AddressSanitizer with 4.9 breaks printng some variables in gdb
Date: Fri, 22 May 2015 08:56:00 -0000	[thread overview]
Message-ID: <bug-61071-4-GVaUD9LcKk@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61071-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-05-22
                 CC|                            |aoliva at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
--param asan-use-after-return=0 makes this work, without that in order to
support use after return the variables don't live in stack frame
(unconditionally), so are based on some pointer (which is assigned either a
stack slot address or return value from libasan function), and as -O0 -g
doesn't perform var-tracking, it then really depends on register allocation, if
the pseudo register holding that pointer is assigned some hard register through
the whole function (that is the case with t[36] apparently), or not.
For -O0 to have this working reliably, supposedly we'd have to store that
pointer into the stack and turning it into an artificial var, then add
DECL_VALUE_EXPR for all the other stack vars if they are based on this pointer
(Alex, any other thoughts?).
For -O1+/-Og/-Os, I'm surprised var-tracking doesn't handle this.


      parent reply	other threads:[~2015-05-22  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06  5:31 [Bug sanitizer/61071] New: With certain configurations of variables on function's stack, when debugging 32bit binary compiled with '-fsanitize=address', some variables in gdb are printed out as '<optimized out>' despite passing '-O0 -ggdb3' in compilation switches athantor+gccbugzilla at athi dot pl
2014-07-23  6:46 ` [Bug sanitizer/61071] Compiling with AddressSanitizer with 4.9 breaks printng some variables in gdb athantor+gccbugzilla at athi dot pl
2015-05-22  8:03 ` athantor+gccbugzilla at athi dot pl
2015-05-22  8:56 ` jakub at gcc dot gnu.org [this message]

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-61071-4-GVaUD9LcKk@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).