aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-06-12 05:44:59 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-06-26 15:17:49 -0700
commit727efd27da90fe09ed393c7bb44bba071ae0e0d3 (patch)
tree87ff43981c07e1902048cdd0d14878d32dc39fb6
parent00e90d3d4cb51fd0fae7b2dbd4bab1db26d6676e (diff)
downloadgcc-727efd27da90fe09ed393c7bb44bba071ae0e0d3.zip
gcc-727efd27da90fe09ed393c7bb44bba071ae0e0d3.tar.gz
gcc-727efd27da90fe09ed393c7bb44bba071ae0e0d3.tar.bz2
Linux/i386: Remove SUBTARGET_FRAME_POINTER_REQUIRED
config/i386/gnu-user.h has #define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile ix86_frame_pointer_required() has /* Several x86 os'es need a frame pointer for other reasons, usually pertaining to setjmp. */ if (SUBTARGET_FRAME_POINTER_REQUIRED) return true; ... if (crtl->profile && !flag_fentry) return true; A frame pointer is needed only for -pg, not for -mfentry -pg. Remove SUBTARGET_FRAME_POINTER_REQUIRED from gnu-user.h to make i386 GCC behave the same as x86-64 GCC. This fixes FAIL: gcc.target/i386/pr93492-3.c scan-assembler \t.cfi_startproc\n\tendbr(32|64)\n.*.LPFE1:\n\tnop\n1:\tcall\t__fentry__\n\tret\n FAIL: gcc.target/i386/pr93492-5.c scan-assembler \t.cfi_startproc\n.*.LPFE1:\n\tnop\n1:\tcall\t__fentry__\n\tret\n on Linux/i386. PR target/95655 * config/i386/gnu-user.h (SUBTARGET_FRAME_POINTER_REQUIRED): Removed. * config/i386/i386.c (ix86_frame_pointer_required): Update comments.
-rw-r--r--gcc/config/i386/gnu-user.h6
-rw-r--r--gcc/config/i386/i386.c2
2 files changed, 2 insertions, 6 deletions
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
index ae4aa84..6ec5a11 100644
--- a/gcc/config/i386/gnu-user.h
+++ b/gcc/config/i386/gnu-user.h
@@ -39,12 +39,6 @@ along with GCC; see the file COPYING3. If not see
#undef MCOUNT_NAME
#define MCOUNT_NAME "mcount"
-/* The GLIBC version of mcount for the x86 assumes that there is a
- frame, so we cannot allow profiling without a frame pointer. */
-
-#undef SUBTARGET_FRAME_POINTER_REQUIRED
-#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile
-
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 37aaa49..5c373c0 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -5267,6 +5267,8 @@ ix86_frame_pointer_required (void)
|| ix86_current_function_calls_tls_descriptor))
return true;
+ /* Several versions of mcount for the x86 assumes that there is a
+ frame, so we cannot allow profiling without a frame pointer. */
if (crtl->profile && !flag_fentry)
return true;