regclass.c (scan_one_insn): Set loop_cost to 1 when optimizing for size.
authorJan Hubicka <hubicka@freesoft.cz>
Tue, 14 Dec 1999 12:56:06 +0000 (13:56 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 14 Dec 1999 12:56:06 +0000 (12:56 +0000)
* regclass.c (scan_one_insn): Set loop_cost to 1 when
optimizing for size.

From-SVN: r30918

gcc/ChangeLog
gcc/regclass.c

index 5dbd9a695dc69eef954bdf71721a15573b2874cd..62f07341c1100e847ac59f67a39be7d1ad745e15 100644 (file)
@@ -1,3 +1,8 @@
+Tue Dec 14 13:51:38 MET 1999  Jan Hubicka  <hubicka@freesoft.cz>
+
+       * regclass.c (scan_one_insn): Set loop_cost to 1 when
+       optimizing for size.
+
 1999-12-14  Bernd Schmidt  <bernds@cygnus.co.uk>
 
        * reload1.c (reload): Can't avoid select_reload_regs/finish_spills
index a67d91e100b264324c58a2cec99364638ee91160..e8eca4de2fc88cd6f4fef7b49c550a2129c1392a 100644 (file)
@@ -829,9 +829,14 @@ scan_one_insn (insn, pass)
   if (code == NOTE)
     {
       if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
-       loop_depth++, loop_cost = 1 << (2 * MIN (loop_depth, 5));
+       loop_depth++;
       else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END)
-       loop_depth--, loop_cost = 1 << (2 * MIN (loop_depth, 5));
+       loop_depth--;
+
+      if (optimize_size)
+       loop_cost = 1;
+      else
+       loop_cost = 1 << (2 * MIN (loop_depth, 5));
 
       return insn;
     }