From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21919 invoked by alias); 5 Feb 2015 12:00:09 -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 21856 invoked by uid 48); 5 Feb 2015 12:00:06 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/64937] [5 Regression] compare debug failure with -fsanitize=address Date: Thu, 05 Feb 2015 12:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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-02/txt/msg00446.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64937 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org --- Comment #4 from Jakub Jelinek --- I think the problem is that cgraph etc. uses the DECL_ABSTRACT_P flag, which is set in two different places: 1) in the C++ FE 2) in dwarf2out In the latter, it does: was_abstract = DECL_ABSTRACT_P (decl); set_decl_abstract_flags (decl, 1); dwarf2out_decl (decl); if (! was_abstract) set_decl_abstract_flags (decl, 0); So, if the decl was already abstract, it doesn't reset anything. But, unfortunately, the set_decl_abstract_flags call is recursive, and not all the vars in there necessary have DECL_ABSTRACT_P flag already set. Thus, I think either we should make sure that when the C++ FE sets DECL_ABSTRACT_P flag on something, it is always set on all the contained decls too (but how to ensure this if we e.g. further decls are added in various passes to those functions?), or we should change dwarf2out.c to reset it always to the previous state, rather than sometimes clearing it (despite it might be set already before) and sometimes setting it and not clearing it afterwards. For the latter, guess we could just add a vec into which we'd push the decls on which we set the flag, and reversion would be performed by walking the vector and clearing DECL_ABSTRACT_P flags. I guess I'll try to implement the dwarf2out.c change.