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: Unreviewed patches for 3.2


Richard Henderson writes:

> On Wed, Jul 03, 2002 at 10:47:47PM +0200, Rainer Orth wrote:
> > * 3.2 PATCH: Make ASM_DEBUG_SPEC a compile-time constant
> > 
> > 	http://gcc.gnu.org/ml/gcc-patches/2002-06/msg02041.html
> 
> This is incorrect.  You're trying to compare enumeration values in
> the preprocessor.  This "works" in that undefined symbols both expand
> to zero in cpp arithmetic, which gave you 0 == 0, which happened to
> be the result you were looking for.

I already noticed that it doesn't give the expected result ;-(  After
reviewing the thread that introduced the ?: in ASM_DEBUG_SPEC, I came up
with the following patch instead.  It compiles with IRIX 6 O32 cc and
PREFERRED_DEBUGGING_TYPE set to DWARF2_DEBUG and yields the expected
ASM_DEBUG_SPEC.

Ok that way, or do I need another full bootstrap (which will take about two
days)?

	Rainer


Thu Jul  4 02:08:04 2002  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* gcc/gcc.c (asm_debug): Move initialization ...
	(init_spec): ... here.

Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.326
diff -u -p -r1.326 gcc.c
--- gcc.c	26 Jun 2002 02:58:51 -0000	1.326
+++ gcc.c	4 Jul 2002 00:07:23 -0000
@@ -646,7 +646,7 @@ proper position among the other output f
 # define STARTFILE_PREFIX_SPEC ""
 #endif
 
-static const char *asm_debug = ASM_DEBUG_SPEC;
+static const char *asm_debug;
 static const char *cpp_spec = CPP_SPEC;
 static const char *cpp_predefines = CPP_PREDEFINES;
 static const char *cc1_spec = CC1_SPEC;
@@ -1482,6 +1482,10 @@ init_spec ()
       next = sl;
     }
 #endif
+
+  /* Initialize here, not in definition.  The IRIX 6 O32 cc sometimes chokes
+     on ?: in file-scope variable initializations.  */
+  asm_debug = ASM_DEBUG_SPEC;
 
   for (i = ARRAY_SIZE (static_specs) - 1; i >= 0; i--)
     {


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