* loop.c (scan_loop): Do not insert temporaries for hard registers.
authorDaniel Jacobowitz <dan@codesourcery.com>
Tue, 15 Nov 2005 14:33:04 +0000 (14:33 +0000)
committerDaniel Jacobowitz <drow@gcc.gnu.org>
Tue, 15 Nov 2005 14:33:04 +0000 (14:33 +0000)
From-SVN: r107019

gcc/ChangeLog
gcc/loop.c

index f2b22fa98a252162d04ba27fd5a08b95082245e0..3b723f917ebae5ba45c8b771970bdc1703e68c34 100644 (file)
@@ -1,3 +1,7 @@
+2005-11-15  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * loop.c (scan_loop): Do not insert temporaries for hard registers.
+
 2005-11-15  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * config/arm/lib1funcs.asm (div0) [L_dvmd_lnx]: Call raise instead
index 6df63026ab833a88b3542239997b512037d65c18..9efc84eff931df34b732d1fc8c496ecabb229a5b 100644 (file)
@@ -1238,13 +1238,15 @@ scan_loop (struct loop *loop, int flags)
                 - with -Os (this certainly increases size),
                 - if the mode doesn't support copy operations (obviously),
                 - if the source is already a reg (the motion will gain nothing),
-                - if the source is a legitimate constant (likewise).  */
+                - if the source is a legitimate constant (likewise),
+                - if the dest is a hard register (may be unrecognizable).  */
              else if (insert_temp
                       && (optimize_size
                           || ! can_copy_p (GET_MODE (SET_SRC (set)))
                           || REG_P (SET_SRC (set))
                           || (CONSTANT_P (SET_SRC (set))
-                              && LEGITIMATE_CONSTANT_P (SET_SRC (set)))))
+                              && LEGITIMATE_CONSTANT_P (SET_SRC (set)))
+                          || REGNO (SET_DEST (set)) < FIRST_PSEUDO_REGISTER))
                ;
              else if ((tem = loop_invariant_p (loop, src))
                       && (dependencies == 0