re PR target/68701 ("gcc -m32 -finstrument-functions -ffixed-ebp" produces internal compiler error)

PR target/68701
	* config/i386/i386.c (ix86_option_override_internal): Enable
	-maccumulate-outgoing-args when %ebp is fixed due to stack
	realignment requirements.

testsuite/ChangeLog:

	PR target/68701
	* testsuite/gcc.target/i386/pr68701-1.c: New test.
	* testsuite/gcc.target/i386/pr68701-2.c: Ditto.

From-SVN: r231419
This commit is contained in:
Uros Bizjak 2015-12-08 19:41:21 +01:00 committed by Uros Bizjak
parent 0b8d93e55f
commit 9e5d0977ff
5 changed files with 48 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2015-12-08 Uros Bizjak <ubizjak@gmail.com>
PR target/68701
* config/i386/i386.c (ix86_option_override_internal): Enable
-maccumulate-outgoing-args when %ebp is fixed due to stack
realignment requirements.
2015-12-08 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/68640

View File

@ -5296,6 +5296,17 @@ ix86_option_override_internal (bool main_args_p,
opts->x_target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
}
/* Stack realignment without -maccumulate-outgoing-args requires %ebp,
so enable -maccumulate-outgoing-args when %ebp is fixed. */
if (fixed_regs[BP_REG]
&& !(opts->x_target_flags & MASK_ACCUMULATE_OUTGOING_ARGS))
{
if (opts_set->x_target_flags & MASK_ACCUMULATE_OUTGOING_ARGS)
warning (0, "fixed ebp register requires %saccumulate-outgoing-args%s",
prefix, suffix);
opts->x_target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
}
/* Figure out what ASM_GENERATE_INTERNAL_LABEL builds as a prefix. */
{
char *p;

View File

@ -1,3 +1,9 @@
2015-12-08 Uros Bizjak <ubizjak@gmail.com>
PR target/68701
* testsuite/gcc.target/i386/pr68701-1.c: New test.
* testsuite/gcc.target/i386/pr68701-2.c: Ditto.
2015-12-08 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/sse4_1-round.h (do_round): Fix inline asm statements.

View File

@ -0,0 +1,13 @@
/* { dg-do compile } */
/* { dg-options "-O -ffixed-ebp -mno-accumulate-outgoing-args" } */
/* { dg-warning "fixed ebp register requires" "" { target *-*-* } 0 } */
void foo (void);
int
main (int argc, char *argv[])
{
foo ();
return argc - 1;
}

View File

@ -0,0 +1,11 @@
/* { dg-do compile } */
/* { dg-options "-O -ffixed-ebp -mno-accumulate-outgoing-args -mstackrealign -msse" } */
/* { dg-warning "fixed ebp register requires" "" { target *-*-* } 0 } */
typedef float V __attribute__((vector_size(16)));
void bar (V a)
{
volatile V b = a;
}