sh.c (broken_move): Constant 0.
authorJ"orn Rennecke <joern.rennecke@superh.com>
Fri, 12 Apr 2002 10:55:32 +0000 (10:55 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Fri, 12 Apr 2002 10:55:32 +0000 (11:55 +0100)
* sh.c (broken_move): Constant 0. / 1. load is OK if there is
no r0 clobber.

From-SVN: r52214

gcc/ChangeLog
gcc/config/sh/sh.c

index 1957b4375b289dd9aef173adc8d795a622e433d6..b62485ac028cf2db294b20e943b11bace5bf4d19 100644 (file)
@@ -1,3 +1,8 @@
+Fri Apr 12 10:51:38 2002  J"orn Rennecke <joern.rennecke@superh.com>
+
+       * sh.c (broken_move): Constant 0. / 1. load is OK if there is
+       no r0 clobber.
+
 2002-04-12  Andreas Schwab  <schwab@suse.de>
 
        * config/ia64/ia64.h (EXTRA_SPECS): Fix missing backslash.
index ff3c08930ea4d8d6384d5b3645b9828179f1e4dc..815d8dcff061ff039d0bb0b76f96d4643910be3b 100644 (file)
@@ -2507,9 +2507,16 @@ broken_move (insn)
                && GET_CODE (SET_SRC (pat)) == CONST_DOUBLE
                && (fp_zero_operand (SET_SRC (pat))
                    || fp_one_operand (SET_SRC (pat)))
-               /* ??? If this is a -m4 or -m4-single compilation, we don't
-                  know the current setting of fpscr, so disable fldi.  */
-               && (! TARGET_SH4 || TARGET_FMOVD)
+               /* ??? If this is a -m4 or -m4-single compilation, in general
+                  we don't know the current setting of fpscr, so disable fldi.
+                  There is an exception if this was a register-register move
+                  before reload - and hence it was ascertained that we have
+                  single precision setting - and in a post-reload optimization
+                  we changed this to do a constant load.  In that case
+                  we don't have an r0 clobber, hence we must use fldi.  */
+               && (! TARGET_SH4 || TARGET_FMOVD
+                   || (GET_CODE (XEXP (XVECEXP (PATTERN (insn), 0, 2), 0))
+                       == SCRATCH))
                && GET_CODE (SET_DEST (pat)) == REG
                && FP_REGISTER_P (REGNO (SET_DEST (pat))))
          && (GET_CODE (SET_SRC (pat)) != CONST_INT