public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dwmw2 at infradead dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/28744] externally_visible attribute not effective with prior declaration of symbol.
Date: Fri, 18 Aug 2006 11:12:00 -0000	[thread overview]
Message-ID: <20060818111158.8398.qmail@sourceware.org> (raw)
In-Reply-To: <bug-28744-9416@http.gcc.gnu.org/bugzilla/>



------- Comment #10 from dwmw2 at infradead dot org  2006-08-18 11:11 -------
I've hacked around this for now by reverting the patch for PR25795 and doing
this instead:

--- gcc/c-decl.c~       2006-01-19 23:48:07.000000000 +0000
+++ gcc/c-decl.c        2006-08-15 21:43:43.000000000 +0100
@@ -1660,6 +1660,25 @@ merge_decls (tree newdecl, tree olddecl,
   if (TREE_DEPRECATED (newdecl))
     TREE_DEPRECATED (olddecl) = 1;

+  if (TREE_CODE (newdecl) == FUNCTION_DECL)
+    {
+      struct cgraph_node *n = cgraph_node (newdecl);
+      if (n->local.externally_visible)
+       {
+          struct cgraph_node *o = cgraph_node (olddecl);
+          o->local.externally_visible = true;
+       }
+    }
+  else if (TREE_CODE (newdecl) == VAR_DECL)
+    {
+      struct cgraph_varpool_node *n = cgraph_varpool_node (newdecl);
+      if (n->externally_visible)
+       {
+         struct cgraph_varpool_node *o = cgraph_varpool_node (olddecl);
+         o->externally_visible = true;
+       }
+    }
+
   /* Keep source location of definition rather than declaration and of
      prototype rather than non-prototype unless that prototype is
      built-in.  */
--- gcc/c-common.c~     2006-08-18 10:35:10.000000000 +0100
+++ gcc/c-common.c      2006-08-18 10:52:18.000000000 +0100
@@ -4243,7 +4243,7 @@ handle_externally_visible_attribute (tre
 {
   tree node = *pnode;

-  if ((!TREE_STATIC (node) && TREE_CODE (node) != FUNCTION_DECL)
+  if (0 && (!TREE_STATIC (node) && TREE_CODE (node) != FUNCTION_DECL)
       || !TREE_PUBLIC (node))
     {
       warning (OPT_Wattributes,


-- 


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


  parent reply	other threads:[~2006-08-18 11:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-15 20:01 [Bug c/28744] New: " dwmw2 at infradead dot org
2006-08-15 20:06 ` [Bug c/28744] " jakub at gcc dot gnu dot org
2006-08-15 21:04 ` pinskia at gcc dot gnu dot org
2006-08-15 21:08 ` pinskia at gcc dot gnu dot org
2006-08-15 21:18 ` jakub at gcc dot gnu dot org
2006-08-16 10:23 ` jakub at gcc dot gnu dot org
2006-08-16 13:17 ` jakub at gcc dot gnu dot org
2006-08-16 18:11 ` dwmw2 at infradead dot org
2006-08-17  9:16 ` dwmw2 at infradead dot org
2006-08-17 11:52 ` jakub at gcc dot gnu dot org
2006-08-17 12:20 ` jakub at gcc dot gnu dot org
2006-08-18 11:12 ` dwmw2 at infradead dot org [this message]
2006-08-20 12:42 ` hubicka at ucw dot cz
2006-08-20 12:53 ` aldot at gcc dot gnu dot org
2006-08-20 12:59 ` hubicka at ucw dot cz
2006-08-20 13:12 ` hubicka at ucw dot cz
2006-08-20 13:15 ` aldot at gcc dot gnu dot org
2006-10-06 11:45 ` jakub at gcc dot gnu dot org
2008-01-15 18:09 ` alexandre dot nunes at gmail dot com
     [not found] <bug-28744-4@http.gcc.gnu.org/bugzilla/>
2012-03-24 22:10 ` hubicka at gcc dot gnu.org

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=20060818111158.8398.qmail@sourceware.org \
    --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).