From 4090b65231d4a3e80fa3c8971748bef4c9a55341 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 7 Aug 2017 13:28:47 +0000 Subject: [PATCH] Revert r250916 From-SVN: r250917 --- gcc/ChangeLog | 4 ++++ gcc/config/i386/i386.c | 26 +++++++++++------------ gcc/testsuite/ChangeLog | 7 ++++++ gcc/testsuite/gcc.target/i386/pr81736-1.c | 13 ------------ gcc/testsuite/gcc.target/i386/pr81736-2.c | 14 ------------ gcc/testsuite/gcc.target/i386/pr81736-3.c | 11 ---------- gcc/testsuite/gcc.target/i386/pr81736-4.c | 11 ---------- 7 files changed, 23 insertions(+), 63 deletions(-) delete mode 100644 gcc/testsuite/gcc.target/i386/pr81736-1.c delete mode 100644 gcc/testsuite/gcc.target/i386/pr81736-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/pr81736-3.c delete mode 100644 gcc/testsuite/gcc.target/i386/pr81736-4.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 01eb3354dc5..310ad80dd79 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2017-08-07 H.J. Lu + + * config/i386/i386.c: Revert the last change. + 2017-08-07 H.J. Lu PR target/81736 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 4683da3f24d..c0b6015991d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -14116,24 +14116,22 @@ output_probe_stack_range (rtx reg, rtx end) return ""; } -/* Finalize stack_realign_needed and frame_pointer_needed flags, which - will guide prologue/epilogue to be generated in correct form. */ - +/* Finalize stack_realign_needed flag, which will guide prologue/epilogue + to be generated in correct form. */ static void -ix86_finalize_stack_frame_flags (void) +ix86_finalize_stack_realign_flags (void) { /* Check if stack realign is really needed after reload, and stores result in cfun */ unsigned int incoming_stack_boundary = (crtl->parm_stack_boundary > ix86_incoming_stack_boundary ? crtl->parm_stack_boundary : ix86_incoming_stack_boundary); - bool stack_realign + unsigned int stack_realign = (incoming_stack_boundary < (crtl->is_leaf && !ix86_current_function_calls_tls_descriptor ? crtl->max_used_stack_slot_alignment : crtl->stack_alignment_needed)); bool recompute_frame_layout_p = false; - bool omit_frame_pointer = flag_omit_frame_pointer != 0; if (crtl->stack_realign_finalized) { @@ -14144,13 +14142,13 @@ ix86_finalize_stack_frame_flags (void) } /* If the only reason for frame_pointer_needed is that we conservatively - assumed stack realignment might be needed or -fno-omit-frame-pointer - is used, but in the end nothing that needed the stack alignment had - been spilled nor stack access, clear frame_pointer_needed and say we - don't need stack realignment. */ - if (stack_realign == omit_frame_pointer + assumed stack realignment might be needed, but in the end nothing that + needed the stack alignment had been spilled, clear frame_pointer_needed + and say we don't need stack realignment. */ + if (stack_realign && frame_pointer_needed && crtl->is_leaf + && flag_omit_frame_pointer && crtl->sp_is_unchanging && !ix86_current_function_calls_tls_descriptor && !crtl->accesses_prior_frames @@ -14341,7 +14339,7 @@ ix86_expand_prologue (void) if (ix86_function_naked (current_function_decl)) return; - ix86_finalize_stack_frame_flags (); + ix86_finalize_stack_realign_flags (); /* DRAP should not coexist with stack_realign_fp */ gcc_assert (!(crtl->drap_reg && stack_realign_fp)); @@ -15205,7 +15203,7 @@ ix86_expand_epilogue (int style) return; } - ix86_finalize_stack_frame_flags (); + ix86_finalize_stack_realign_flags (); frame = m->frame; m->fs.sp_realigned = stack_realign_fp; @@ -15740,7 +15738,7 @@ ix86_expand_split_stack_prologue (void) gcc_assert (flag_split_stack && reload_completed); - ix86_finalize_stack_frame_flags (); + ix86_finalize_stack_realign_flags (); frame = cfun->machine->frame; allocate = frame.stack_pointer_offset - INCOMING_FRAME_SP_OFFSET; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0e750328645..0c234bcf8f7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2017-08-07 H.J. Lu + + * gcc.target/i386/pr81736-1.c: Removed. + * gcc.target/i386/pr81736-2.c: Likewise. + * gcc.target/i386/pr81736-3.c: Likewise. + * gcc.target/i386/pr81736-4.c: Likewise. + 2017-08-07 H.J. Lu PR target/81736 diff --git a/gcc/testsuite/gcc.target/i386/pr81736-1.c b/gcc/testsuite/gcc.target/i386/pr81736-1.c deleted file mode 100644 index 92c7bc97a0d..00000000000 --- a/gcc/testsuite/gcc.target/i386/pr81736-1.c +++ /dev/null @@ -1,13 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fno-omit-frame-pointer" } */ - -extern int i; - -int -foo (void) -{ - return i; -} - -/* No need to use a frame pointer. */ -/* { dg-final { scan-assembler-not "%\[re\]bp" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr81736-2.c b/gcc/testsuite/gcc.target/i386/pr81736-2.c deleted file mode 100644 index a3720879937..00000000000 --- a/gcc/testsuite/gcc.target/i386/pr81736-2.c +++ /dev/null @@ -1,14 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fno-omit-frame-pointer" } */ - -int -#ifndef __x86_64__ -__attribute__((regparm(3))) -#endif -foo (int i) -{ - return i; -} - -/* No need to use a frame pointer. */ -/* { dg-final { scan-assembler-not "%\[re\]bp" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr81736-3.c b/gcc/testsuite/gcc.target/i386/pr81736-3.c deleted file mode 100644 index c3bde7dd933..00000000000 --- a/gcc/testsuite/gcc.target/i386/pr81736-3.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fno-omit-frame-pointer" } */ - -void -foo (void) -{ - asm ("# " : : : "ebx"); -} - -/* Need to use a frame pointer. */ -/* { dg-final { scan-assembler "%\[re\]bp" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr81736-4.c b/gcc/testsuite/gcc.target/i386/pr81736-4.c deleted file mode 100644 index 25f50016a64..00000000000 --- a/gcc/testsuite/gcc.target/i386/pr81736-4.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fno-omit-frame-pointer" } */ - -int -foo (int i1, int i2, int i3, int i4, int i5, int i6, int i7) -{ - return i7; -} - -/* Need to use a frame pointer. */ -/* { dg-final { scan-assembler "%\[re\]bp" } } */ -- 2.30.2