2010-09-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/45234
	* calls.c (expand_call): Make sure that all variable sized
	adjustments are multiple of preferred stack boundary after
	stack alignment.

	* gcc.dg/torture/stackalign/alloca-5.c: Remove.

From-SVN: r164596
This commit is contained in:
Jakub Jelinek 2010-09-24 17:07:36 +02:00 committed by Jakub Jelinek
parent a0ccf2fbe8
commit 9f99fc5900
4 changed files with 15 additions and 45 deletions

View File

@ -1,3 +1,13 @@
2010-09-24 Jakub Jelinek <jakub@redhat.com>
Revert:
2010-09-17 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/45234
* calls.c (expand_call): Make sure that all variable sized
adjustments are multiple of preferred stack boundary after
stack alignment.
2010-09-23 Eric Botcazou <ebotcazou@adacore.com>
Backport from mainline

View File

@ -2374,19 +2374,6 @@ expand_call (tree exp, rtx target, int ignore)
preferred_unit_stack_boundary = preferred_stack_boundary / BITS_PER_UNIT;
if (SUPPORTS_STACK_ALIGNMENT)
{
/* All variable sized adjustments must be multiple of preferred
stack boundary. Stack alignment may change preferred stack
boundary after variable sized adjustments have been made. We
need to compensate it here. */
unsigned HOST_WIDE_INT delta
= ((stack_pointer_delta - pending_stack_adjust)
% preferred_unit_stack_boundary);
if (delta)
anti_adjust_stack (GEN_INT (preferred_unit_stack_boundary - delta));
}
/* We want to make two insn chains; one for a sibling call, the other
for a normal call. We will select one of the two chains after
initial RTL generation is complete. */

View File

@ -1,3 +1,8 @@
2010-09-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/45234
* gcc.dg/torture/stackalign/alloca-5.c: Remove.
2010-09-23 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/torture/stackalign/alloca-4.c: Remove -m32 from dg-options.

View File

@ -1,32 +0,0 @@
/* PR middle-end/45234 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
#include "check.h"
void
__attribute__ ((noinline))
bar (__float128 f)
{
check (&f, __alignof__(f));
}
int
main (void)
{
char *p = __builtin_alloca (6);
bar (0);
__builtin_strncpy (p, "good", 5);
if (__builtin_strncmp (p, "good", 5) != 0)
{
#ifdef DEBUG
p[5] = '\0';
printf ("Failed: %s != good\n", p);
#endif
abort ();
}
return 0;
}