From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2735 invoked by alias); 13 Dec 2012 20:56:42 -0000 Received: (qmail 2618 invoked by uid 55); 13 Dec 2012 20:56:15 -0000 From: "hubicka at ucw dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/53476] [4.8 Regression] FAIL: gcc.dg/attr-weakref-1.c Date: Thu, 13 Dec 2012 20:56: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at ucw dot cz X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-12/txt/msg01355.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53476 --- Comment #10 from Jan Hubicka 2012-12-13 20:56:13 UTC --- > (gdb) call debug_tree (node->symbol.decl) > type size > unit size > align 32 symtab 0 alias set -1 canonical type 0x7ffff67f75e8 precision > 32 min max 2147483647> > pointer_to_this > > addressable used static external weak SI file t.c line 1 col 12 size > unit size > align 32 context attributes > > (mem:SI (symbol_ref/i:DI ("Wv10a") ) [0 > Wv10a+0 S4 A32]) chain > > > it has DECL_EXTERNAL set (but it also is TREE_STATIC and has RTL!). > On the 4.7 branch we simply checked whether the DECL had RTL but didn't bother > to check whether it does not have DECL_EXTERNAL set. > > I'd say either revert to 4.7 behavior here or do > > Index: varpool.c > =================================================================== > --- varpool.c (revision 194472) > +++ varpool.c (working copy) > @@ -358,7 +358,8 @@ varpool_remove_unreferenced_decls (void) > && (!varpool_can_remove_if_no_refs (node) > /* We just expanded all function bodies. See if any of > them needed the variable. */ > - || (!DECL_EXTERNAL (node->symbol.decl) > + || (!(DECL_EXTERNAL (node->symbol.decl) > + && !TREE_STATIC (node->symbol.decl)) Oops, thanks! I had similar hunk sitting in my tree for a while, but forgot to commit it. The point of nor marking extenral as used at this point was to release memory used by identifiers because at this stage they do not matter, but since we gave up on that, I guess this is fine. For 4.9 I think I should look into reorganizing weakrefs to have different tree representation. This abuse of external flag is really anoying. Honza