+2019-05-23 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/i386/darwin.h: Reject -mfentry*.
+ * doc/sourcebuild.texi: Document mfentry target support.
+
2019-05-23 Bill Schmidt <wschmidt@linux.ibm.com>
* config/rs6000/rs6000.c (rs6000_global_entry_point_needed_p):
#define CC1_SPEC "%(cc1_cpu) \
%{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}} \
%{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }} \
- %{mx32:%eDarwin is not an mx32 platform}" \
+ %{mx32:%eDarwin is not an mx32 platform} \
+ %{mfentry*:%eDarwin does not support -mfentry or associated options}" \
DARWIN_CC1_SPEC
#undef ASM_SPEC
@item fma4
Target supports compiling @code{fma4} instructions.
+@item mfentry
+Target supports the @code{-mfentry} option that alters the
+position of profiling calls such that they precede the prologue.
+
@item ms_hook_prologue
Target supports attribute @code{ms_hook_prologue}.
+2019-05-23 Iain Sandoe <iain@sandoe.co.uk>
+
+ * lib/target-supports.exp (check_effective_target_mfentry): New.
+ * gcc.target/i386/fentry-override.c: Require effective target mfentry.
+ * gcc/testsuite/gcc.target/i386/fentry.c: Likewise
+ * gcc.target/i386/fentryname1.c: Likewise
+ * gcc.target/i386/fentryname2.c: Likewise
+ * gcc.target/i386/fentryname3.c: Likewise
+ * gcc.target/i386/nop-mcount.c: Likewise
+ * gcc.target/i386/pr82699-2.c: Likewise
+ * gcc.target/i386/pr82699-4.c: Likewise
+ * gcc.target/i386/pr82699-5.c: Likewise
+ * gcc.target/i386/pr82699-6.c: Likewise
+ * gcc.target/i386/returninst1.c: Likewise
+ * gcc.target/i386/returninst2.c: Likewise
+ * gcc.target/i386/returninst3.c : Likewise
+
2019-05-23 Bill Schmidt <wschmidt@linux.ibm.com>
* gcc.target/powerpc/localentry-1.c: New file.
/* Test -mfentry override */
/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-mfentry" } */
/* { dg-final { scan-assembler-not "__fentry__" } } */
/* Origin: Andi Kleen */
/* Test -mfentry */
/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-fprofile -mfentry" } */
/* { dg-final { scan-assembler "__fentry__" } } */
/* Origin: Andi Kleen */
/* { dg-do compile } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-pg -mfentry -mfentry-name=foo" } */
/* { dg-final { scan-assembler "call.*foo" } } */
/* { dg-final { scan-assembler "call.*bar" } } */
/* { dg-do compile } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-pg -mfentry -mrecord-mcount -mfentry-section=foo" } */
/* { dg-final { scan-assembler "section.*foo" } } */
/* { dg-final { scan-assembler "section.*bar" } } */
/* { dg-do compile } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-pg -mfentry" } */
/* { dg-final { scan-assembler "section.*__entry_loc" } } */
/* { dg-final { scan-assembler "0x0f, 0x1f, 0x44, 0x00, 0x00" } } */
/* Test -mnop-mcount */
/* { dg-do compile { target { *-*-linux* && nonpic } } } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-pg -mfentry -mrecord-mcount -mnop-mcount" } */
/* { dg-final { scan-assembler-not "__fentry__" } } */
/* Origin: Andi Kleen */
/* { dg-do compile { target *-*-linux* } } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-O2 -fno-pic -fcf-protection -pg -mfentry -fasynchronous-unwind-tables" } */
/* { dg-final { scan-assembler-times {\t\.cfi_startproc\n\tendbr} 1 } } */
/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-O2 -fpic -fcf-protection -pg -mfentry -fasynchronous-unwind-tables" } */
/* { dg-final { scan-assembler-times {\t\.cfi_startproc\n\tendbr} 1 } } */
/* { dg-do compile { target *-*-linux* } } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-O2 -fcf-protection -mfentry -fasynchronous-unwind-tables" } */
/* { dg-additional-options "-fno-pic" { target ia32 } } */
/* { dg-final { scan-assembler-times {\t\.cfi_startproc\n\tendbr} 1 } } */
/* { dg-do compile { target *-*-linux* } } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-fno-pic -O2 -fcf-protection -pg -mfentry -mrecord-mcount -mnop-mcount -fasynchronous-unwind-tables" } */
/* { dg-final { scan-assembler-times {\t\.cfi_startproc\n\tendbr} 1 } } */
/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-pg -mfentry -minstrument-return=call -mrecord-return" } */
/* { dg-final { scan-assembler "call.*__return__" } } */
/* { dg-final { scan-assembler "section.*return_loc" } } */
/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-pg -mfentry -minstrument-return=nop5 -mrecord-return" } */
/* { dg-final { scan-assembler-times "0x0f, 0x1f, 0x44, 0x00, 0x00" 3 } } */
/* { dg-final { scan-assembler "section.*return_loc" } } */
/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-require-effective-target mfentry } */
/* { dg-options "-pg -mfentry -minstrument-return=call" } */
/* { dg-final { scan-assembler-not "call.*__return__" } } */
expr { [istarget amdgcn*-*-*]
|| [check_effective_target_offload_gcn] }}]
}
+
+# Return 1 if the compiler supports '-mfentry'.
+
+proc check_effective_target_mfentry { } {
+ if { !([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
+ return 0
+ }
+ return [check_no_compiler_messages mfentry object {
+ void foo (void) { }
+ } "-mfentry"]
+}