]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/10904 (invalid (misaligned) FP register at -O2)
authorGabriel Dos Reis <gdr@cs.tamu.edu>
Sun, 29 Feb 2004 17:59:25 +0000 (17:59 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Sun, 29 Feb 2004 17:59:25 +0000 (17:59 +0000)
Backport from mainline:
2004-01-27  Eric Botcazou  <ebotcazou@libertysurf.fr>
PR target/10904
PR target/13058
* config/sparc/sparc.h (CANNOT_CHANGE_MODE_CLASS): New.
Forbid mode changes from SImode for lower FP regs if ARCH64.

From-SVN: r78656

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

index afe301a72807c7067ab4c95712f84c0244c16537..78a3ce77d60a1007c7b25164735edf36e56cb925 100644 (file)
@@ -1,3 +1,12 @@
+2004-02-29  Gabriel Dos Reis  <gdr@cs.tamu.edu>
+
+       Backport from mainline:
+       2004-01-27  Eric Botcazou  <ebotcazou@libertysurf.fr>
+       PR target/10904
+       PR target/13058
+       * config/sparc/sparc.h (CANNOT_CHANGE_MODE_CLASS): New.
+       Forbid mode changes from SImode for lower FP regs if ARCH64.
+
 2004-02-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * pa.h (TRAMPOLINE_TEMPLATE, TRAMPOLINE_SIZE, TRAMPOLINE_CODE_SIZE,
index 5fe4fabb9c428976acf7264fcfb57f901cd38e56..5706349cbeea4fb1cce024a8200b4312f2a6adbe 100644 (file)
@@ -1233,6 +1233,20 @@ enum reg_class { NO_REGS, FPCC_REGS, I64_REGS, GENERAL_REGS, FP_REGS,
    {-1, -1, -1, 0x20}, /* GENERAL_OR_EXTRA_FP_REGS */  \
    {-1, -1, -1, 0x3f}} /* ALL_REGS */
 
+/* Defines invalid mode changes.  Borrowed from pa64-regs.h.
+
+   SImode loads to floating-point registers are not zero-extended.
+   The definition for LOAD_EXTEND_OP specifies that integer loads
+   narrower than BITS_PER_WORD will be zero-extended.  As a result,
+   we inhibit changes from SImode unless they are to a mode that is
+   identical in size.  */
+
+#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)              \
+  (TARGET_ARCH64                                               \
+   && (FROM) == SImode                                         \
+   && GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)               \
+   ? reg_classes_intersect_p (CLASS, FP_REGS) : 0)
+
 /* The same information, inverted:
    Return the class number of the smallest class containing
    reg number REGNO.  This could be a conditional expression