This is the mail archive of the 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]

3.3.1 PATCH: Fix mips-sgi-irix6o32 bootstrap failure

This patch fixes a bootstrap failure of the mips-sgi-irix6o32 configuration
when using the native IRIX 6 assembler.

There are two problems:

* The SUBTARGET_ASM_DEBUGGING_SPEC currently hardcodes passing the -mdebug
  and -no-mdebug flags to as, but these flags are gas-only and not
  recognized by as.  This is a regression from 3.2.

* Even with this fixed, I still run into the issue described in this

  (and in a recent message to gcc-patches which for some reason hasn't hit
  the archive yet).

This patch fixes both problems:

* The -mdebug/-no-mdebug switches are moved to a new mdebug_asm_spec, which
  is only used with gas.  This requires at least gas 2.13, but I've omitted
  the autoconf check for the flag support since no one seems to have
  complained about this implicit requirement.  I can resurrect the test if
  desired from an old patch:

  Unfortunately mdebug_asm_spec is not fully correct: on platforms with
  DWARF 2 as PREFERRED_DEBUGGING_TYPE, -mdebug needs to be passed only with
  explicit -gstabs*, with stabs-in-mdebug, the current setting is correct.
  Since checking for PREFERRED_DEBUGGING_TYPE requires runtime
  initialization of specs (e.g. as in the old patch above, using an
  approach rth didn't like), I've left this as is.  Targets affected by
  this problem will have to override MDEBUG_ASM_SPEC.

* The ICE still requires the old patch

With those two fixes applied, the 3.3 branch finishes bootstrapping the
compiler proper (both with native as and gas), but still ICEs later when
compiling libf2c/libI77/uio.c.  I'll submit a PR for this shortly.

The first part of the patch applies to mainline as well (bootstrap still in
progress), the second part doesn't apply and has most likely been obsoleted
by the mips rewrite work.

Ok for 3.3 branch and mainline?


Rainer Orth, Faculty of Technology, Bielefeld University

Tue May 27 21:33:11 2003  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* config/mips/mips.h (SUBTARGET_ASM_DEBUGGING_SPEC): Move
	-mdebug/-no-mdebug switches ...
	(MDEBUG_ASM_SPEC): ... here.
	Use only with gas.
	(EXTRA_SPECS): Initialize mdebug_asm_spec.
	(CONSTANT_ADDRESS_P): Allow native IRIX 6 O32 assembler.

Index: gcc/config/mips/mips.h
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.h,v
retrieving revision
diff -u -p -r1.227.4.5 mips.h
--- gcc/config/mips/mips.h	28 Feb 2003 10:41:20 -0000
+++ gcc/config/mips/mips.h	28 May 2003 12:08:54 -0000
@@ -1048,9 +1048,18 @@ extern int mips_abi;
 %{gstabs:-g} %{gstabs0:-g0} %{gstabs1:-g1} %{gstabs2:-g2} %{gstabs3:-g3} \
 %{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3} \
 %{gcoff:-g} %{gcoff0:-g0} %{gcoff1:-g1} %{gcoff2:-g2} %{gcoff3:-g3} \
-%{!gdwarf*:-mdebug} %{gdwarf*:-no-mdebug}"
+/* Beginning with gas 2.13, -mdebug must be passed to correctly handle COFF
+   and stabs debugging info.  */
+/* GAS */
+#define MDEBUG_ASM_SPEC "%{!gdwarf*:-mdebug} %{gdwarf*:-no-mdebug}"
+#else /* not GAS */
+#define MDEBUG_ASM_SPEC ""
+#endif /* not GAS */
 /* SUBTARGET_ASM_SPEC is always passed to the assembler.  It may be
    overridden by subtargets.  */
@@ -1178,6 +1187,7 @@ extern int mips_abi;
   { "subtarget_mips_as_asm_spec", SUBTARGET_MIPS_AS_ASM_SPEC }, 	\
   { "subtarget_asm_optimizing_spec", SUBTARGET_ASM_OPTIMIZING_SPEC },	\
   { "subtarget_asm_debugging_spec", SUBTARGET_ASM_DEBUGGING_SPEC },	\
+  { "mdebug_asm_spec", MDEBUG_ASM_SPEC },				\
   { "subtarget_asm_spec", SUBTARGET_ASM_SPEC },				\
   { "asm_abi_default_spec", ASM_ABI_DEFAULT_SPEC },			\
   { "endian_spec", ENDIAN_SPEC },					\
@@ -3094,17 +3104,16 @@ typedef struct mips_args {
    assembler would use $at as a temp to load in the large offset.  In this
    case $at is already in use.  We convert such problem addresses to
    `la $5,s;sw $4,70000($5)' via LEGITIMIZE_ADDRESS.  */
-/* ??? SGI Irix 6 assembler fails for CONST address, so reject them
-   when !TARGET_GAS.  */
+/* ??? SGI IRIX 6 assembler fails for CONST address, so reject them
+   when !TARGET_GAS.  At least the IRIX 6 O32 assembler has no problem,
+   though.  */
 /* We should be rejecting everything but const addresses.  */
 #define CONSTANT_ADDRESS_P(X)						\
     || GET_CODE (X) == CONST_INT || GET_CODE (X) == HIGH		\
     || (GET_CODE (X) == CONST						\
 	&& ! (flag_pic && pic_address_needs_scratch (X))		\
-	&& (TARGET_GAS)							\
-	&& (mips_abi != ABI_N32 					\
-	    && mips_abi != ABI_64)))
+	&& (TARGET_GAS || mips_abi == ABI_32)))
 /* Define this, so that when PIC, reload won't try to reload invalid

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