OSDN Git Service

* arm.c (arm_split_constant): Don't try to force a constant to
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Mar 1999 11:40:25 +0000 (11:40 +0000)
committerrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Mar 1999 11:40:25 +0000 (11:40 +0000)
memory after arm_reorg has run.
(after_arm_reorg): New static variable.
(arm_reorg): Set it.
(output_func_epilogue): Clear it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25742 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c

index fb4c7c0..5e2ec7a 100644 (file)
@@ -1,3 +1,11 @@
+Sat Mar 13 11:36:16 1999  Richard Earnshaw (rearnsha@arm.com)
+
+       * arm.c (arm_split_constant): Don't try to force a constant to
+       memory after arm_reorg has run.
+       (after_arm_reorg): New static variable.
+       (arm_reorg): Set it.
+       (output_func_epilogue): Clear it.
+
 Fri Mar 12 20:26:32 1999  David Edelsohn  <edelsohn@mhpcc.edu>
 
        * configure.in ({rs6000,powerpc}-ibm-aix*): Set float_format to none.
index 478c2a0..4a393c9 100644 (file)
@@ -128,6 +128,8 @@ int lr_save_eliminated;
 
 static int return_used_this_function;
 
+static int after_arm_reorg = 0;
+
 static int arm_constant_limit = 3;
 
 /* For an explanation of these variables, see final_prescan_insn below.  */
@@ -604,8 +606,15 @@ arm_split_constant (code, mode, val, target, source, subtargets)
       || (GET_CODE (target) == REG && GET_CODE (source) == REG
          && REGNO (target) != REGNO (source)))
     {
-      if (arm_gen_constant (code, mode, val, target, source, 1, 0)
-         > arm_constant_limit + (code != SET))
+      /* After arm_reorg has been called, we can't fix up expensive
+        constants by pushing them into memory so we must synthesise
+        them in-line, regardless of the cost.  This is only likely to
+        be more costly on chips that have load delay slots and we are
+        compiling without running the scheduler (so no splitting
+        occurred before the final instruction emission.  */
+      if (! after_arm_reorg
+         && (arm_gen_constant (code, mode, val, target, source, 1, 0)
+             > arm_constant_limit + (code != SET)))
        {
          if (code == SET)
            {
@@ -4022,6 +4031,8 @@ arm_reorg (first)
          insn = scan;
        }
     }
+
+  after_arm_reorg = 1;
 }
 
 \f
@@ -5378,7 +5389,9 @@ output_func_epilogue (f, frame_size)
 
 epilogue_done:
 
+  /* Reset the ARM-specific per-function variables.  */
   current_function_anonymous_args = 0;
+  after_arm_reorg = 0;
 }
 
 static void