]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
reg-stack.c (straighten_stack): Do nothing if the virtual stack is empty or has a...
authorJeff Law <law@gcc.gnu.org>
Fri, 2 Oct 1998 00:17:52 +0000 (18:17 -0600)
committerJeff Law <law@gcc.gnu.org>
Fri, 2 Oct 1998 00:17:52 +0000 (18:17 -0600)
0
        * reg-stack.c (straighten_stack): Do nothing if the virtual stack is
        empty or has a single entry.

From-SVN: r22728

gcc/reg-stack.c

index ab400c51f1d12df09ebedd78b1ff7114b732aab6..a7a5fb7cd9022042df90ea8c6e26e6ee70987d70 100644 (file)
@@ -309,6 +309,13 @@ straighten_stack (insn, regstack)
   struct stack_def temp_stack;
   int top;
 
+  /* If there is only a single register on the stack, then the stack is
+     already in increasing order and no reorganization is needed.
+
+     Similarly if the stack is empty.  */
+  if (regstack->top <= 0)
+    return;
+
   temp_stack.reg_set = regstack->reg_set;
 
   for (top = temp_stack.top = regstack->top; top >= 0; top--)