This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/61071] Compiling with AddressSanitizer with 4.9 breaks printng some variables in gdb
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 May 2015 08:56:50 +0000
- Subject: [Bug sanitizer/61071] Compiling with AddressSanitizer with 4.9 breaks printng some variables in gdb
- Auto-submitted: auto-generated
- References: <bug-61071-4 at http dot gcc dot gnu dot 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.