public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ PATCH for c++/49353 (emitting functions with DECL_EXTERNAL set)
@ 2011-07-07  5:35 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2011-07-07  5:35 UTC (permalink / raw)
  To: gcc-patches List

[-- Attachment #1: Type: text/plain, Size: 353 bytes --]

The C++ front end sets DECL_EXTERNAL on functions and variables with 
vague linkage during most of compilation, and then clears the flag at 
EOF if we actually want to emit them.  But we were failing to clear 
DECL_EXTERNAL in the case of inlines that we are emitting because of 
-fkeep-inline-functions.

Tested x86_64-pc-linux-gnu, applying to trunk.

[-- Attachment #2: 49353.patch --]
[-- Type: text/x-patch, Size: 712 bytes --]

commit 600157c6ee5b6425f47b24d03dceaa4b5ac06359
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jul 6 18:01:40 2011 -0400

    	PR c++/49353
    	* semantics.c (expand_or_defer_fn_1): Clear DECL_EXTERNAL
    	on kept inlines.

diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 6fcf0da..5caeafe 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3634,7 +3634,10 @@ expand_or_defer_fn_1 (tree fn)
 	   && !DECL_REALLY_EXTERN (fn))
 	  || (flag_keep_inline_dllexport
 	      && lookup_attribute ("dllexport", DECL_ATTRIBUTES (fn))))
-	mark_needed (fn);
+	{
+	  mark_needed (fn);
+	  DECL_EXTERNAL (fn) = 0;
+	}
     }
 
   /* There's no reason to do any of the work here if we're only doing

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-07  2:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-07  5:35 C++ PATCH for c++/49353 (emitting functions with DECL_EXTERNAL set) Jason Merrill

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).