Commit 1c84b798 by Ian Lance Taylor Committed by Ian Lance Taylor

explow.c (allocate_dynamic_stack_space): Call do_pending_stack_adjust before…

explow.c (allocate_dynamic_stack_space): Call do_pending_stack_adjust before handling flag_split_stack.

gcc/:
	* explow.c (allocate_dynamic_stack_space): Call
	do_pending_stack_adjust before handling flag_split_stack.
gcc/testsuite/:
	* gcc.dg/split-7.c: New test.

From-SVN: r240764
parent 8f8d78e6
2016-10-04 Ian Lance Taylor <iant@golang.org>
* explow.c (allocate_dynamic_stack_space): Call
do_pending_stack_adjust before handling flag_split_stack.
2016-10-04 David Malcolm <dmalcolm@redhat.com>
* genattrtab.c (make_internal_attr): Supply dummy column number to
......
......@@ -1357,6 +1357,8 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
current_function_has_unbounded_dynamic_stack_size = 1;
}
do_pending_stack_adjust ();
final_label = NULL;
final_target = NULL_RTX;
......@@ -1414,8 +1416,6 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
emit_label (available_label);
}
do_pending_stack_adjust ();
/* We ought to be called always on the toplevel and stack ought to be aligned
properly. */
gcc_assert (!(stack_pointer_delta
......
2016-10-04 Ian Lance Taylor <iant@golang.org>
* gcc.dg/split-7.c: New test.
2016-10-04 Martin Sebor <msebor@redhat.com>
* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Cast int argument to
......
/* { dg-do run } */
/* { dg-require-effective-target split_stack } */
/* { dg-options "-fsplit-stack -O2" } */
/* { dg-options "-fsplit-stack -O2 -mno-accumulate-outgoing-args" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
/* A case that used to fail on 32-bit x86 when optimizing and not
using -maccumulate-args. The stack adjustment of the alloca got
mixed up with the arguments pushed on the stack to the function
before the call of alloca. */
#include <stdlib.h>
typedef struct { const char* s; int l; } s;
typedef unsigned long long align16 __attribute__ ((aligned(16)));
s gobats (const void *, int) __attribute__ ((noinline));
s
gobats (const void* p __attribute__ ((unused)),
int l __attribute__ ((unused)))
{
s v;
v.s = 0;
v.l = 0;
return v;
}
void check_aligned (void *p) __attribute__ ((noinline));
void
check_aligned (void *p)
{
if (((__SIZE_TYPE__) p & 0xf) != 0)
abort ();
}
void gap (void *) __attribute__ ((noinline));
void gap (void *p)
{
align16 a;
check_aligned (&a);
}
int
main (int argc, char **argv)
{
s *space;
gobats(0, 16);
space = (s *) alloca(sizeof(s) + 1);
*space = (s){0, 16};
gap(space);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment