public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-53476-4-nWj9jjB1WM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53476-4@http.gcc.gnu.org/bugzilla/>


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53476

--- Comment #10 from Jan Hubicka <hubicka at ucw dot cz> 2012-12-13 20:56:13 UTC ---
> (gdb) call debug_tree (node->symbol.decl)
>  <var_decl 0x7ffff68045f0 Wv10a
>     type <integer_type 0x7ffff67f75e8 int public SI
>         size <integer_cst 0x7ffff67fa0c0 constant 32>
>         unit size <integer_cst 0x7ffff67fa0e0 constant 4>
>         align 32 symtab 0 alias set -1 canonical type 0x7ffff67f75e8 precision
> 32 min <integer_cst 0x7ffff67fa060 -2147483648> max <integer_cst 0x7ffff67fa080
> 2147483647>
>         pointer_to_this <pointer_type 0x7ffff67ff2a0>>
>     addressable used static external weak SI file t.c line 1 col 12 size
> <integer_cst 0x7ffff67fa0c0 32> unit size <integer_cst 0x7ffff67fa0e0 4>
>     align 32 context <translation_unit_decl 0x7ffff6918000 D.1721> attributes
> <tree_list 0x7ffff68f3c08>
>     (mem:SI (symbol_ref/i:DI ("Wv10a") <var_decl 0x7ffff68045f0 Wv10a>) [0
> Wv10a+0 S4 A32]) chain <var_decl 0x7ffff6804688 Wv10b>>
> 
> 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


      parent reply	other threads:[~2012-12-13 20:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-24 14:32 [Bug middle-end/53476] New: " hjl.tools at gmail dot com
2012-05-24 15:33 ` [Bug middle-end/53476] " hjl.tools at gmail dot com
2012-05-24 17:57 ` hp at gcc dot gnu.org
2012-05-28 15:17 ` Greta.Yorsh at arm dot com
2012-05-29 12:07 ` hubicka at gcc dot gnu.org
2012-05-29 13:26 ` ro at gcc dot gnu.org
2012-09-07 12:06 ` rguenth at gcc dot gnu.org
2012-09-26 21:58 ` sje at gcc dot gnu.org
2012-09-26 22:04 ` sje at gcc dot gnu.org
2012-12-13 13:50 ` rguenth at gcc dot gnu.org
2012-12-13 15:21 ` rguenth at gcc dot gnu.org
2012-12-13 15:22 ` rguenth at gcc dot gnu.org
2012-12-13 20:56 ` hubicka at ucw dot cz [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-53476-4-nWj9jjB1WM@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).