Fix for Darwin bootstrap bug

dalej@apple.com dalej@apple.com
Tue May 15 18:55:00 GMT 2001


This fixes the bootstrapping bug on Darwin which has been reported a few 
times (shows up as incorrect use of R0 as an address).   The most recent 
report is appended following the patch.

2001-05-15  Dale Johannesen     <dalej@apple.com>

         * config/rs6000/rs6000.c  Fix Darwin-specific misuse of R0 as a 
reload address

===================================================================
RCS file: /cvs/repository/CoreTools/gcc3/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -b -w -p -r1.19 -r1.20
--- rs6000.c    2001/05/08 02:44:15     1.19
+++ rs6000.c    2001/05/16 01:08:19     1.20
@@ -3573,17 +3573,21 @@ secondary_reload_class (class, mode, in)
  {
    int regno;

-#if TARGET_ELF
+/** APPLE LOCAL **/
+  if (TARGET_ELF || (DEFAULT_ABI==ABI_DARWIN && flag_pic))
+    {
    /* We can not copy a symbolic operand directly into anything other 
than
       BASE_REGS for TARGET_ELF.  So indicate that a register from 
BASE_REGS
-     is needed as an intermediate register.  */
+        is needed as an intermediate register.
+         On Darwin, pic addresses require a load from memory, which 
needs
+        a base register. */
    if (class != BASE_REGS
        && (GET_CODE (in) == SYMBOL_REF
           || GET_CODE (in) == HIGH
           || GET_CODE (in) == LABEL_REF
           || GET_CODE (in) == CONST))
      return BASE_REGS;
-#endif
+    }

    if (GET_CODE (in) == REG)
      {
===================================================================
"Marcus G. Daniels" wrote:

I have made it through a bootstrap before on Darwin, but for the last
week or two I've been seeing crashes like below.  (I haven't tried on a 
Linux
PowerPC box..)

stage1/xgcc -Bstage1/ -B/packages/powerpc-apple-darwin1.3.3/bin/ -c  
-DIN_GCC    -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes 
-Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  
-DHAVE_CONFIG_H    -I. -I. -I/src/gcc/gcc -I/src/gcc/gcc/. 
-I/src/gcc/gcc/config -I/src/gcc/gcc/../include /src/gcc/gcc/reload1.c 
-o reload1.o
/src/gcc/gcc/reload1.c: In function `replace_pseudos_in_call_usage':
/src/gcc/gcc/reload1.c:624: warning: comparison between signed and 
unsigned
/src/gcc/gcc/reload1.c: In function `reload_as_needed':
/src/gcc/gcc/reload1.c:3962: warning: comparison between signed and 
unsigned
/src/gcc/gcc/reload1.c:4029: warning: comparison between signed and 
unsigned
/src/gcc/gcc/reload1.c:3818: warning: `prev' might be used uninitialized 
in this function
/src/gcc/gcc/reload1.c: In function `emit_reload_insns':
/src/gcc/gcc/reload1.c:7317: Insn does not satisfy its constraints:
(insn 4680 4679 4681 (set:SI (reg/u:SI 0 r0)
         (plus:SI (reg:SI 31 r31)
             (high:SI (const:SI (minus:SI (symbol_ref:SI 
("&L_rld$non_lazy_ptr"))
                         (symbol_ref:SI ("*L56$pb"))))))) 37 
{addsi3_high} (nil)
     (nil))
/src/gcc/gcc/reload1.c:7317: Internal compiler error in 
reload_cse_simplify_operands, at reload1.c:8350



More information about the Gcc-patches mailing list