]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix c/5351 and optimization/7591.
authorH.J. Lu <hjl@gnu.org>
Fri, 8 Nov 2002 22:12:37 +0000 (22:12 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 8 Nov 2002 22:12:37 +0000 (14:12 -0800)
2002-11-08  H.J. Lu <hjl@gnu.org>

Fix c/5351 and optimization/7591.

* calls.c (store_one_arg): Remove ATTRIBUTE_UNUSED on
variable_size. Mark any slots used for the argument as in-use
only if we can't pass all arguments to a library call in
registers.

From-SVN: r58937

gcc/ChangeLog
gcc/calls.c

index 447403410998999d0f697980b5379f69c8aeb729..40983df71faeef46c09beaee3039471801d99727 100644 (file)
@@ -1,3 +1,12 @@
+2002-11-08  H.J. Lu <hjl@gnu.org>
+
+       Fix c/5351 and optimization/7591.
+
+       * calls.c (store_one_arg): Remove ATTRIBUTE_UNUSED on
+       variable_size. Mark any slots used for the argument as in-use
+       only if we can't pass all arguments to a library call in
+       registers.
+
 2002-11-07  H.J. Lu <hjl@gnu.org>
 
        Fix bootstrap/8146 and
index df39596ed10008cd908898d13566df469cf398e8..a40b466e4a960c4e211c3c5b1227d4442c0df5dc 100644 (file)
@@ -4284,7 +4284,7 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
      struct arg_data *arg;
      rtx argblock;
      int flags;
-     int variable_size ATTRIBUTE_UNUSED;
+     int variable_size;
      int reg_parm_stack_space;
 {
   tree pval = arg->tree_value;
@@ -4359,14 +4359,22 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
                  emit_move_insn (arg->save_area, stack_area);
                }
            }
+
+         /* Now that we have saved any slots that will be overwritten
+            by this store, mark all slots this store will use.  We
+            must do this before we actually expand the argument since
+            the expansion itself may trigger library calls which might
+            need to use the same stack slot. We only do it if we can't
+            pass all arguments to a library call in registers.  */
+         if (arg->partial)
+           {
+             for (i = lower_bound; i < upper_bound; i++)
+               stack_usage_map[i] = 1;
+
+             /* Set it so that we don't do it again.  */
+             variable_size = 1;
+           }
        }
-      /* Now that we have saved any slots that will be overwritten by this
-        store, mark all slots this store will use.  We must do this before
-        we actually expand the argument since the expansion itself may
-        trigger library calls which might need to use the same stack slot.  */
-      if (argblock && ! variable_size && arg->stack)
-       for (i = lower_bound; i < upper_bound; i++)
-         stack_usage_map[i] = 1;
     }
 
   /* If this isn't going to be placed on both the stack and in registers,
@@ -4594,6 +4602,11 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
        arg->value = arg->stack_slot;
     }
 
+  if (ACCUMULATE_OUTGOING_ARGS && !(flags & ECF_SIBCALL)
+      && argblock && ! variable_size && arg->stack)
+    for (i = lower_bound; i < upper_bound; i++)
+      stack_usage_map[i] = 1;
+
   /* Once we have pushed something, pops can't safely
      be deferred during the rest of the arguments.  */
   NO_DEFER_POP;