public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* HPPA constructor merge patch, PR middle-end/45388
@ 2010-09-28 12:18 Steve Ellcey
  2010-09-28 12:26 ` Richard Henderson
  0 siblings, 1 reply; 26+ messages in thread
From: Steve Ellcey @ 2010-09-28 12:18 UTC (permalink / raw)
  To: gcc-patches; +Cc: hubicka, dave

A lot of C++ tests started failing on HPPA with r163443, the constructor
merge patch.  HPPA (in 32 bit mode) does not have .ctors and .dtors
sections so it uses the collect2 magic name functionality to handle
static constructors.

In ipa.c at build_cdtor_fns the code says:

/* Generate functions to call static constructors and destructors
   for targets that do not support .ctors/.dtors sections.  These
   functions have magic names which are detected by collect2.  */

The problem is that while build_cdtor turns off DECL_STATIC_CONSTRUCTOR
(and DECL_STATIC_DESTRUCTOR) it does net set TREE_PUBLIC to 1 for these
functions and it is TREE_PUBLIC that is used in
ASM_DECLARE_FUNCTION_NAME to decide whether or not to make the
constructor or destructor name externally visible.  If it is not
externally visible then collect2 will not find the names in order to
set up the needed constructors.

Tested on hppa2.0w-hp-hpux11.11 (32 bit mode) with no regressions.
OK to checkin?

Steve Ellcey
sje@cup.hp.com


2010-09-27  Steve Ellcey  <sje@cup.hp.com>

	PR middle-end/45388
	* ipa.c: Set TREE_PUBLIC on constructors/destructors.


Index: ipa.c
===================================================================
--- ipa.c	(revision 164643)
+++ ipa.c	(working copy)
@@ -1477,6 +1477,7 @@ build_cdtor (bool ctor_p, VEC (tree, hea
 	    DECL_STATIC_CONSTRUCTOR (fn) = 0;
 	  else
 	    DECL_STATIC_DESTRUCTOR (fn) = 0;
+	  TREE_PUBLIC (fn) = 1;
 	  /* We do not want to optimize away pure/const calls here.
 	     When optimizing, these should be already removed, when not
 	     optimizing, we want user to be able to breakpoint in them.  */

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2010-12-14 10:29 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-28 12:18 HPPA constructor merge patch, PR middle-end/45388 Steve Ellcey
2010-09-28 12:26 ` Richard Henderson
2010-09-28 13:03   ` Steve Ellcey
2010-09-28 13:28     ` Richard Henderson
2010-09-28 15:21       ` Jan Hubicka
2010-09-28 18:56         ` John David Anglin
2010-09-28 19:05           ` Jan Hubicka
2010-09-28 19:45             ` Richard Henderson
2010-09-28 19:59               ` Jan Hubicka
2010-11-08 21:49                 ` John David Anglin
2010-12-06 22:53                 ` Steve Ellcey
2010-12-12 17:46                 ` John David Anglin
2010-12-12 20:15                   ` Mark Mitchell
2010-12-12 22:05                     ` Jan Hubicka
2010-12-13  0:30                       ` Jan Hubicka
2010-12-13  1:04                         ` John David Anglin
2010-12-13 13:36                           ` John David Anglin
2010-12-13 13:40                             ` Jan Hubicka
2010-12-13 15:38                               ` Mark Mitchell
2010-12-13 17:33                                 ` Jan Hubicka
2010-12-13 17:52                                   ` Mark Mitchell
2010-12-13 18:45                                     ` Jan Hubicka
2010-12-13 21:42                                       ` John David Anglin
2010-12-14  7:08                                       ` H.J. Lu
2010-12-14 11:24                                         ` Jan Hubicka
2010-12-14 12:04                                           ` Richard Henderson

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