]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sparc.h (LEGITIMIZE_RELOAD_ADDRESS): Do nothing with operands that require PIC code...
authorJeffrey A Law <law@cygnus.com>
Sat, 12 Jun 1999 02:42:16 +0000 (02:42 +0000)
committerJeff Law <law@gcc.gnu.org>
Sat, 12 Jun 1999 02:42:16 +0000 (20:42 -0600)

        * sparc.h (LEGITIMIZE_RELOAD_ADDRESS): Do nothing with operands
        that require PIC code sequences.
Fixes libstdc++ & libg++ failures on sparc platforms.

From-SVN: r27493

gcc/ChangeLog
gcc/config/sparc/sparc.h

index 83248e57030d92298a269f5c073e5ac3f3eff0ae..5e793da37113fd16a1fdba558b967cf3ebc17375 100644 (file)
@@ -1,3 +1,8 @@
+Sat Jun 12 03:40:42 1999  Jeffrey A Law  (law@cygnus.com)
+
+       * sparc.h (LEGITIMIZE_RELOAD_ADDRESS): Do nothing with operands
+       that require PIC code sequences.
+
 Fri Jun 11 03:17:51 1999  Jeffrey A Law  (law@cygnus.com)
 
        * Makefile.in (libgcc2): Pass MAYBE_USE_COLLECT2 as an argument.
index b00a145164ddf2386a9426444c56df94d99c52ac..2c1a5b506dbe3acc2fc25ff61ace27a6bc7e7f70 100644 (file)
@@ -2584,8 +2584,11 @@ extern struct rtx_def *legitimize_pic_address ();
 
    For Sparc 32, we wish to handle addresses by splitting them into
    HIGH+LO_SUM pairs, retaining the LO_SUM in the memory reference. 
-   This cuts the number of extra insns by one.  */
-   
+   This cuts the number of extra insns by one.
+
+   Do nothing when generating PIC code and the address is a
+   symbolic operand or requires a scratch register.  */
+
 #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN)     \
 do {                                                                    \
   /* Decompose SImode constants into hi+lo_sum.  We do have to                 \
@@ -2593,7 +2596,10 @@ do {                                                                    \
   if (CONSTANT_P (X)                                                   \
       && (MODE != TFmode || TARGET_V9)                                 \
       && GET_MODE (X) == SImode                                                \
-      && GET_CODE (X) != LO_SUM && GET_CODE (X) != HIGH)               \
+      && GET_CODE (X) != LO_SUM && GET_CODE (X) != HIGH                        \
+      && ! (flag_pic                                                   \
+           && (symbolic_operand (X, Pmode))                            \
+               || pic_address_needs_scratch (X)))                      \
     {                                                                  \
       X = gen_rtx_LO_SUM (GET_MODE (X),                                        \
                          gen_rtx_HIGH (GET_MODE (X), X), X);           \