This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH [alternative] to fix mingw bootstrap failure


Per Bothner wrote:

I notice other targets (rs6000, arm, pa, possibly others)
instead modify the SYMBOL_REF in place, smashing in a new name.

That may be a better solution.  If that is the recommended
approach (which seems plausible), I'll try that instead.

This alternative patch uses the smash-name-in-place approach. It seems to work on my simple testcase at least

I don't know any convenient way to test this, except to do
a mingw build (using Mohan's scripts).  Assuming this works,
is this OK to check in?  Perhaps someone else can test this
patch for their winnt target setup?
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/
2004-05-29  Per Bothner  <per@bothner.com>

	* config/i386/winnt.c (i386_pe_encode_section_info):  Replace label
	name in-place, without creating a new SYMBOL_REF.  This avoid problems
	such as failing to copy over SYMBOL_REF_DECL and SYMBOL_REF_WEAK.

Index: config/i386/winnt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/winnt.c,v
retrieving revision 1.65
diff -u -r1.65 winnt.c
--- config/i386/winnt.c	30 Apr 2004 22:26:48 -0000	1.65
+++ config/i386/winnt.c	29 May 2004 23:54:18 -0000
@@ -490,14 +490,11 @@
 
   if (TREE_CODE (decl) == FUNCTION_DECL)
     {
-      if (lookup_attribute ("stdcall",
-			    TYPE_ATTRIBUTES (TREE_TYPE (decl))))
-        XEXP (DECL_RTL (decl), 0) =
-	  gen_rtx_SYMBOL_REF (Pmode, gen_stdcall_suffix (decl));
-      else if (lookup_attribute ("fastcall",
-				 TYPE_ATTRIBUTES (TREE_TYPE (decl))))
-        XEXP (DECL_RTL (decl), 0) =
-	  gen_rtx_SYMBOL_REF (Pmode, gen_fastcall_suffix (decl));
+      tree type_attributes = TYPE_ATTRIBUTES (TREE_TYPE (decl));
+      if (lookup_attribute ("stdcall", type_attributes))
+	XSTR (XEXP (rtl, 0), 0) = gen_stdcall_suffix (decl);
+      else if (lookup_attribute ("fastcall", type_attributes))
+	XSTR (XEXP (rtl, 0), 0) = gen_fastcall_suffix (decl);
     }
 
   /* Mark the decl so we can tell from the rtl whether the object is

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]