From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123987 invoked by alias); 22 May 2015 08:56:55 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 123933 invoked by uid 48); 22 May 2015 08:56:52 -0000 From: "jakub at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-05/txt/msg01883.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61071 Jakub Jelinek 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 --- --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.