With revision 259496:
commit
b1384095a7c1d06a44b70853372ebe037b2f7867
Author: hjl <hjl@
138bc75d-0d04-0410-961f-
82ee72b054a4>
Date: Thu Apr 19 15:15:04 2018 +0000
x86: Enable -fcf-protection with multi-byte NOPs
-fcf-protection no longer depens on -mcet and with revision 259522:
commit
d59cfa9a4064339cf2bd2da828c4c133f13e57f0
Author: hjl <hjl@
138bc75d-0d04-0410-961f-
82ee72b054a4>
Date: Fri Apr 20 13:30:13 2018 +0000
Define __CET__ for -fcf-protection and remove -mibt
-mcet becomes an alias for -mshstk.
We can remove -mcet/-mno-cet where they are unused and replace -mcet
with -mshstk where -mcet is used as an alias for -mshstk.
PR target/85485
* g++.dg/cet-notrack-1.C (dg-options): Remove -mcet.
* g++.dg/torture/pr85334.C (dg-additional-options): Likwise.
* gcc.dg/pr85388-1.c (dg-options): Likwise.
* gcc.dg/pr85388-2.c (dg-options): Likwise.
* gcc.dg/pr85388-3.c (dg-options): Likwise.
* gcc.dg/pr85388-4.c (dg-options): Likwise.
* gcc.dg/pr85388-5.c (dg-options): Likwise.
* gcc.dg/pr85388-6.c (dg-options): Likwise.
* gcc.dg/torture/pr85397-1.c (dg-additional-options): Likwise.
* gcc.target/i386/attr-nocf-check-1a.c (dg-options): Likwise.
* gcc.target/i386/attr-nocf-check-3a.c (dg-options): Likwise.
* gcc.target/i386/cet-label.c (dg-options): Likwise.
* gcc.target/i386/cet-label-2.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-1b.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-2a.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-2b.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-3.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-4b.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-5a.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-5b.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-6a.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-6b.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-7.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-icf-2.c (dg-options): Likwise.
* gcc.target/i386/cet-notrack-icf-4.c (dg-options): Likwise.
* gcc.target/i386/cet-property-1.c (dg-options): Likwise.
* gcc.target/i386/cet-property-2.c (dg-options): Likwise.
* gcc.target/i386/cet-sjlj-1.c (dg-options): Likwise.
* gcc.target/i386/cet-sjlj-2.c (dg-options): Likwise.
* gcc.target/i386/cet-sjlj-3.c (dg-options): Likwise.
* gcc.target/i386/cet-sjlj-4.c (dg-options): Likwise.
* gcc.target/i386/cet-sjlj-5.c (dg-options): Likwise.
* gcc.target/i386/cet-sjlj-6a.c (dg-options): Likwise.
* gcc.target/i386/cet-sjlj-6b.c (dg-options): Likwise.
* gcc.target/i386/cet-switch-1.c (dg-options): Likwise.
* gcc.target/i386/cet-switch-2.c (dg-options): Likwise.
* gcc.target/i386/cet-switch-3.c (dg-options): Likwise.
* gcc.target/i386/indirect-thunk-11.c (dg-options): Likwise.
* gcc.target/i386/indirect-thunk-12.c (dg-options): Likwise.
* gcc.target/i386/indirect-thunk-attr-12.c (dg-options): Likwise.
* gcc.target/i386/indirect-thunk-attr-13.c (dg-options): Likwise.
* gcc.target/i386/indirect-thunk-attr-14.c (dg-options): Likwise.
* gcc.target/i386/indirect-thunk-attr-15.c (dg-options): Likwise.
* gcc.target/i386/indirect-thunk-attr-16.c (dg-options): Likwise.
* gcc.target/i386/indirect-thunk-extern-8.c (dg-options): Likwise.
* gcc.target/i386/indirect-thunk-extern-9.c (dg-options): Likwise.
* gcc.target/i386/indirect-thunk-extern-10.c (dg-options): Likwise.
* gcc.target/i386/pr82659-1.c (dg-options): Likwise.
* gcc.target/i386/pr82659-2.c (dg-options): Likwise.
* gcc.target/i386/pr82659-3.c (dg-options): Likwise.
* gcc.target/i386/pr82659-4.c (dg-options): Likwise.
* gcc.target/i386/pr82659-5.c (dg-options): Likwise.
* gcc.target/i386/pr82659-6.c (dg-options): Likwise.
* gcc.target/i386/pr84146.c (dg-options): Likwise.
* gcc.target/i386/pr85403.c (dg-options): Likwise.
* gcc.target/i386/pr85404.c (dg-options): Likwise.
* gcc.target/i386/cet-intrin-3.c (dg-options): Replace -mcet
with -mshstk.
* gcc.target/i386/cet-intrin-5.c (dg-options): Likwise.
* gcc.target/i386/cet-intrin-6.c (dg-options): Likwise.
* gcc.target/i386/cet-intrin-7.c (dg-options): Likwise.
* gcc.target/i386/cet-intrin-8.c (dg-options): Likwise.
* gcc.target/i386/cet-intrin-9.c (dg-options): Likwise.
* gcc.target/i386/cet-intrin-10.c (dg-options): Likwise.
* gcc.target/i386/cet-rdssp-1.c (dg-options): Likwise.
* (dg-options): Likwise.
* gcc.target/i386/cet-notrack-1a.c (dg-options): Remove
-mno-cet.
* gcc.target/i386/cet-notrack-4a.c (dg-options): Likwise.
* gcc.target/i386/cet-label-3.c: Removed.
* gcc.target/i386/cet-property-3.c: Likwise.
* gcc.target/i386/cet-sjlj-7.c: Likwise.
From-SVN: r259612
+
+ PR target/85485
+ * g++.dg/cet-notrack-1.C (dg-options): Remove -mcet.
+ * g++.dg/torture/pr85334.C (dg-additional-options): Likwise.
+ * gcc.dg/pr85388-1.c (dg-options): Likwise.
+ * gcc.dg/pr85388-2.c (dg-options): Likwise.
+ * gcc.dg/pr85388-3.c (dg-options): Likwise.
+ * gcc.dg/pr85388-4.c (dg-options): Likwise.
+ * gcc.dg/pr85388-5.c (dg-options): Likwise.
+ * gcc.dg/pr85388-6.c (dg-options): Likwise.
+ * gcc.dg/torture/pr85397-1.c (dg-additional-options): Likwise.
+ * gcc.target/i386/attr-nocf-check-1a.c (dg-options): Likwise.
+ * gcc.target/i386/attr-nocf-check-3a.c (dg-options): Likwise.
+ * gcc.target/i386/cet-label.c (dg-options): Likwise.
+ * gcc.target/i386/cet-label-2.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-1b.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-2a.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-2b.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-3.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-4b.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-5a.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-5b.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-6a.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-6b.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-7.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-icf-2.c (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-icf-4.c (dg-options): Likwise.
+ * gcc.target/i386/cet-property-1.c (dg-options): Likwise.
+ * gcc.target/i386/cet-property-2.c (dg-options): Likwise.
+ * gcc.target/i386/cet-sjlj-1.c (dg-options): Likwise.
+ * gcc.target/i386/cet-sjlj-2.c (dg-options): Likwise.
+ * gcc.target/i386/cet-sjlj-3.c (dg-options): Likwise.
+ * gcc.target/i386/cet-sjlj-4.c (dg-options): Likwise.
+ * gcc.target/i386/cet-sjlj-5.c (dg-options): Likwise.
+ * gcc.target/i386/cet-sjlj-6a.c (dg-options): Likwise.
+ * gcc.target/i386/cet-sjlj-6b.c (dg-options): Likwise.
+ * gcc.target/i386/cet-switch-1.c (dg-options): Likwise.
+ * gcc.target/i386/cet-switch-2.c (dg-options): Likwise.
+ * gcc.target/i386/cet-switch-3.c (dg-options): Likwise.
+ * gcc.target/i386/indirect-thunk-11.c (dg-options): Likwise.
+ * gcc.target/i386/indirect-thunk-12.c (dg-options): Likwise.
+ * gcc.target/i386/indirect-thunk-attr-12.c (dg-options): Likwise.
+ * gcc.target/i386/indirect-thunk-attr-13.c (dg-options): Likwise.
+ * gcc.target/i386/indirect-thunk-attr-14.c (dg-options): Likwise.
+ * gcc.target/i386/indirect-thunk-attr-15.c (dg-options): Likwise.
+ * gcc.target/i386/indirect-thunk-attr-16.c (dg-options): Likwise.
+ * gcc.target/i386/indirect-thunk-extern-8.c (dg-options): Likwise.
+ * gcc.target/i386/indirect-thunk-extern-9.c (dg-options): Likwise.
+ * gcc.target/i386/indirect-thunk-extern-10.c (dg-options): Likwise.
+ * gcc.target/i386/pr82659-1.c (dg-options): Likwise.
+ * gcc.target/i386/pr82659-2.c (dg-options): Likwise.
+ * gcc.target/i386/pr82659-3.c (dg-options): Likwise.
+ * gcc.target/i386/pr82659-4.c (dg-options): Likwise.
+ * gcc.target/i386/pr82659-5.c (dg-options): Likwise.
+ * gcc.target/i386/pr82659-6.c (dg-options): Likwise.
+ * gcc.target/i386/pr84146.c (dg-options): Likwise.
+ * gcc.target/i386/pr85403.c (dg-options): Likwise.
+ * gcc.target/i386/pr85404.c (dg-options): Likwise.
+ * gcc.target/i386/cet-intrin-3.c (dg-options): Replace -mcet
+ with -mshstk.
+ * gcc.target/i386/cet-intrin-5.c (dg-options): Likwise.
+ * gcc.target/i386/cet-intrin-6.c (dg-options): Likwise.
+ * gcc.target/i386/cet-intrin-7.c (dg-options): Likwise.
+ * gcc.target/i386/cet-intrin-8.c (dg-options): Likwise.
+ * gcc.target/i386/cet-intrin-9.c (dg-options): Likwise.
+ * gcc.target/i386/cet-intrin-10.c (dg-options): Likwise.
+ * gcc.target/i386/cet-rdssp-1.c (dg-options): Likwise.
+ * (dg-options): Likwise.
+ * gcc.target/i386/cet-notrack-1a.c (dg-options): Remove
+ -mno-cet.
+ * gcc.target/i386/cet-notrack-4a.c (dg-options): Likwise.
+ * gcc.target/i386/cet-label-3.c: Removed.
+ * gcc.target/i386/cet-property-3.c: Likwise.
+ * gcc.target/i386/cet-sjlj-7.c: Likwise.
+
2018-04-24 Jakub Jelinek <jakub@redhat.com>
PR target/85511
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-fcf-protection -mcet" } */
+/* { dg-options "-fcf-protection" } */
/* { dg-final { scan-assembler "endbr32|endbr64" } } */
/* { dg-final { scan-assembler-times "\tcall\[ \t]+puts" 2 } } */
/* { dg-final { scan-assembler-times "notrack call\[ \t]+" 1 } } */
// { dg-do run { target { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } }
// { dg-require-effective-target cet }
-// { dg-additional-options "-fexceptions -fnon-call-exceptions -fcf-protection -mcet" }
+// { dg-additional-options "-fexceptions -fnon-call-exceptions -fcf-protection" }
#include <signal.h>
#include <stdlib.h>
/* { dg-do run { target { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } */
/* { dg-require-effective-target cet } */
/* { dg-require-effective-target split_stack } */
-/* { dg-options "-fsplit-stack -fcf-protection -mcet" } */
+/* { dg-options "-fsplit-stack -fcf-protection" } */
#include <stdlib.h>
#include <sys/types.h>
/* { dg-require-effective-target cet } */
/* { dg-require-effective-target split_stack } */
/* { dg-require-effective-target pthread_h } */
-/* { dg-options "-pthread -fsplit-stack -fcf-protection -mcet" } */
+/* { dg-options "-pthread -fsplit-stack -fcf-protection" } */
#include <stdlib.h>
#include <pthread.h>
/* { dg-do run { target { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } */
/* { dg-require-effective-target cet } */
/* { dg-require-effective-target split_stack } */
-/* { dg-options "-fsplit-stack -fcf-protection -mcet" } */
+/* { dg-options "-fsplit-stack -fcf-protection" } */
#include <stdarg.h>
#include <stdlib.h>
/* { dg-do run { target { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } */
/* { dg-require-effective-target cet } */
/* { dg-require-effective-target split_stack } */
-/* { dg-options "-fsplit-stack -fcf-protection -mcet" } */
+/* { dg-options "-fsplit-stack -fcf-protection" } */
#include <stdlib.h>
#include <string.h>
/* { dg-do run { target { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } */
/* { dg-require-effective-target cet } */
/* { dg-require-effective-target split_stack } */
-/* { dg-options "-fsplit-stack -fcf-protection -mcet" } */
+/* { dg-options "-fsplit-stack -fcf-protection" } */
/* This test is like split-3.c, but tests with a smaller stack frame,
since that uses a different prologue. */
/* { dg-do run { target { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } */
/* { dg-require-effective-target cet } */
/* { dg-require-effective-target split_stack } */
-/* { dg-options "-fsplit-stack -O2 -fcf-protection -mcet" } */
-/* { dg-options "-fsplit-stack -O2 -mno-accumulate-outgoing-args -fcf-protection -mcet" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-fsplit-stack -O2 -fcf-protection" } */
+/* { dg-options "-fsplit-stack -O2 -mno-accumulate-outgoing-args -fcf-protection" { 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
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-require-effective-target cet } */
-/* { dg-additional-options "-fcf-protection -mcet" } */
+/* { dg-additional-options "-fcf-protection" } */
#define DEPTH 1000
/* { dg-do compile } */
-/* { dg-options "-fcf-protection -mcet" } */
+/* { dg-options "-fcf-protection" } */
int func (int) __attribute__ ((nocf_check));
int (*fptr) (int) __attribute__ ((nocf_check));
/* { dg-do compile } */
-/* { dg-options "-fcf-protection -mcet" } */
+/* { dg-options "-fcf-protection" } */
int foo (void) __attribute__ ((nocf_check));
void (*foo1) (void) __attribute__((nocf_check));
/* { dg-do compile } */
-/* { dg-options "-O2 -mcet" } */
+/* { dg-options "-O2 -mshstk" } */
/* { dg-final { scan-assembler-times "clrssbsy" 1 } } */
#include <immintrin.h>
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection -mshstk" } */
/* { dg-final { scan-assembler-times "endbr32" 2 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 4 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler "rdsspd|incsspd\[ \t]+(%|)eax" { target ia32 } } } */
/* { dg-do compile } */
-/* { dg-options "-O2 -mcet" } */
+/* { dg-options "-O2 -mshstk" } */
/* { dg-final { scan-assembler-times "saveprevssp" 1 } } */
#include <immintrin.h>
/* { dg-do compile } */
-/* { dg-options "-O2 -mcet" } */
+/* { dg-options "-O2 -mshstk" } */
/* { dg-final { scan-assembler-times "rstorssp" 1 } } */
#include <immintrin.h>
/* { dg-do compile } */
-/* { dg-options "-O2 -mcet" } */
+/* { dg-options "-O2 -mshstk" } */
/* { dg-final { scan-assembler-times "wrssd" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "wrss\[d|q]" 2 { target lp64 } } } */
/* { dg-do compile } */
-/* { dg-options "-O2 -mcet" } */
+/* { dg-options "-O2 -mshstk" } */
/* { dg-final { scan-assembler-times "wrussd" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "wruss\[d|q]" 2 { target lp64 } } } */
/* { dg-do compile } */
-/* { dg-options "-O2 -mcet" } */
+/* { dg-options "-O2 -mshstk" } */
/* { dg-final { scan-assembler-times "setssbsy" 1 } } */
#include <immintrin.h>
/* Verify that CET works. */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 3 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 3 { target { ! ia32 } } } } */
+++ /dev/null
-/* Verify that -fcf-protection works without -mcet. */
-/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection" } */
-/* { dg-final { scan-assembler-times "endbr32" 3 { target ia32 } } } */
-/* { dg-final { scan-assembler-times "endbr64" 3 { target { ! ia32 } } } } */
-
-int func (int arg)
-{
- static void *array[] = { &&foo, &&bar };
-
- goto *array[arg];
-foo:
- return arg*111;
-bar:
- return arg*777;
-}
-/* Verify that CET works. */
+/* Verify that -fcf-protection works. */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 3 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 3 { target { ! ia32 } } } } */
/* { dg-do compile } */
-/* { dg-options "-O0 -fcf-protection=none -mno-cet" } */
+/* { dg-options "-O0 -fcf-protection=none" } */
/* { dg-final { scan-assembler-not "endbr" } } */
/* { dg-final { scan-assembler-not "notrack call\[ \t]+" } } */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "notrack call\[ \t]+" 2 } } */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "notrack call\[ \t]+" 1 } } */
/* { dg-do compile } */
-/* { dg-options "-O2 -fcf-protection -mcet" } */
+/* { dg-options "-O2 -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "notrack jmp\[ \t]+" 1 } } */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "notrack call\[ \t]+" 1 } } */
/* { dg-do compile } */
-/* { dg-options "-fcf-protection=none -mno-cet" } */
+/* { dg-options "-fcf-protection=none" } */
int var1 __attribute__((nocf_check)); /* { dg-warning "'nocf_check' attribute only applies to function types" } */
int *var2 __attribute__((nocf_check)); /* { dg-warning "'nocf_check' attribute only applies to function types" } */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
int var1 __attribute__((nocf_check)); /* { dg-warning "'nocf_check' attribute only applies to function types" } */
int *var2 __attribute__((nocf_check)); /* { dg-warning "'nocf_check' attribute only applies to function types" } */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-not "\tcall\[ \t]+" } } */
/* Check the attribute do not proparate through assignment. */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "\tcall\[ \t]+" 1 } } */
/* { dg-do compile } */
-/* { dg-options "-O2 -fcf-protection -mcet" } */
+/* { dg-options "-O2 -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "\t(?:call|jmp)\[ \t]+.*foo" 1 } } */
/* { dg-do compile } */
-/* { dg-options "-O0 -fcf-protection -mcet" } */
+/* { dg-options "-O0 -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-not "\tcall\[ \t]+" } } */
/* Check the notrack prefix is not generated for direct call. */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "notrack call\[ \t]+.*foo" 0 } } */
/* Verify nocf_check functions are not ICF optimized. */
/* { dg-do compile } */
-/* { dg-options "-O2 -fcf-protection -mcet" } */
+/* { dg-options "-O2 -fcf-protection" } */
/* { dg-final { scan-assembler "endbr" } } */
/* { dg-final { scan-assembler "fn3:" } } */
/* { dg-final { scan-assembler "set\[ \t]+fn2,fn1" } } */
/* Verify nocf_check function calls are not ICF optimized. */
/* { dg-do compile } */
-/* { dg-options "-O2 -fcf-protection -mcet" } */
+/* { dg-options "-O2 -fcf-protection" } */
/* { dg-final { scan-assembler "endbr" } } */
/* { dg-final { scan-assembler "fn2:" } } */
/* { dg-final { scan-assembler "set\[ \t]+fn3,fn1" } } */
/* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-fcf-protection -mcet" } */
+/* { dg-options "-fcf-protection" } */
/* { dg-final { scan-assembler ".note.gnu.property" } } */
extern void foo (void);
/* { dg-do compile } */
-/* { dg-options "-mcet -fcf-protection=none" } */
+/* { dg-options "-fcf-protection=none" } */
/* { dg-final { scan-assembler-not ".note.gnu.property" } } */
extern void foo (void);
+++ /dev/null
-/* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-fcf-protection" } */
-/* { dg-final { scan-assembler ".note.gnu.property" } } */
-
-extern void foo (void);
-
-void
-bar (void)
-{
- foo ();
-}
/* { dg-do run { target cet } } */
-/* { dg-options "-O2 -fcf-protection -mcet" } */
+/* { dg-options "-O2 -fcf-protection -mshstk" } */
void _exit(int status) __attribute__ ((__noreturn__));
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 4 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 4 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "rdssp\[dq]" 2 } } */
/* { dg-do run { target cet } } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
#include "cet-sjlj-1.c"
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 4 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 4 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "call _?setjmp" 1 } } */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 3 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 3 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "rdssp\[dq]" 2 } } */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 2 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 2 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "call _?setjmp" 1 } } */
/* { dg-do compile { target { ! ia32 } } } */
/* { dg-require-effective-target maybe_x32 } */
-/* { dg-options "-O -maddress-mode=short -fcf-protection -mcet -mx32" } */
+/* { dg-options "-O -maddress-mode=short -fcf-protection -mx32" } */
/* { dg-final { scan-assembler-times "endbr64" 2 } } */
/* { dg-final { scan-assembler-times "movq\t.*buf\\+8" 1 } } */
/* { dg-final { scan-assembler-times "subq\tbuf\\+8" 1 } } */
/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O -maddress-mode=long -fcf-protection -mcet -mx32" } */
+/* { dg-options "-O -maddress-mode=long -fcf-protection -mx32" } */
/* { dg-final { scan-assembler-times "endbr64" 2 } } */
/* { dg-final { scan-assembler-times "movq\t.*buf\\+16" 1 } } */
/* { dg-final { scan-assembler-times "subq\tbuf\\+16" 1 } } */
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection" } */
-/* { dg-final { scan-assembler-times "endbr32" 2 { target ia32 } } } */
-/* { dg-final { scan-assembler-times "endbr64" 2 { target { ! ia32 } } } } */
-/* { dg-final { scan-assembler-times "call _?setjmp" 1 } } */
-/* { dg-final { scan-assembler-times "call longjmp" 1 } } */
-
-#include <stdio.h>
-#include <setjmp.h>
-
-jmp_buf buf;
-static int bar (int);
-
-__attribute__ ((noinline, noclone))
-static int
-foo (int i)
-{
- int j = i * 11;
-
- if (!setjmp (buf))
- {
- j += 33;
- printf ("After setjmp: j = %d\n", j);
- bar (j);
- }
-
- return j + i;
-}
-
-__attribute__ ((noinline, noclone))
-static int
-bar (int i)
-{
- int j = i;
-
- j -= 111;
- printf ("In longjmp: j = %d\n", j);
- longjmp (buf, 1);
-
- return j;
-}
-
-int
-main ()
-{
- foo (10);
- return 0;
-}
/* Verify that CET works. */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet" } */
+/* { dg-options "-O -fcf-protection" } */
/* { dg-final { scan-assembler-times "endbr32" 1 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 1 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "notrack jmp\[ \t]+\[*]" 1 } } */
/* Verify that CET works. */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet -mcet-switch" } */
+/* { dg-options "-O -fcf-protection -mcet-switch" } */
/* { dg-final { scan-assembler-times "endbr32" 12 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 12 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "\[ \t]+jmp\[ \t]+\[*]" 1 } } */
/* Verify that CET works. */
/* { dg-do compile } */
-/* { dg-options "-O -fcf-protection -mcet -mcet-switch" } */
+/* { dg-options "-O -fcf-protection -mcet-switch" } */
/* { dg-final { scan-assembler-times "endbr32" 12 { target ia32 } } } */
/* { dg-final { scan-assembler-times "endbr64" 12 { target { ! ia32 } } } } */
/* { dg-final { scan-assembler-times "\[ \t]+jmp\[ \t]+\[*]" 1 } } */
/* { dg-do compile { target { ! x32 } } } */
-/* { dg-options "-O2 -mindirect-branch=thunk-extern -fcf-protection -mcet -fcheck-pointer-bounds -mmpx" } */
+/* { dg-options "-O2 -mindirect-branch=thunk-extern -fcf-protection -fcheck-pointer-bounds -mmpx" } */
void
bar (void)
/* { dg-do compile { target { ! x32 } } } */
-/* { dg-options "-O2 -mindirect-branch=thunk -fcf-protection -mcet -fcheck-pointer-bounds -mmpx" } */
+/* { dg-options "-O2 -mindirect-branch=thunk -fcf-protection -fcheck-pointer-bounds -mmpx" } */
void
bar (void)
/* { dg-do compile { target { ! x32 } } } */
-/* { dg-options "-O2 -mindirect-branch=keep -fcf-protection -mcet -fcheck-pointer-bounds -mmpx" } */
+/* { dg-options "-O2 -mindirect-branch=keep -fcf-protection -fcheck-pointer-bounds -mmpx" } */
__attribute__ ((indirect_branch("thunk-extern")))
void
/* { dg-do compile { target { ! x32 } } } */
-/* { dg-options "-O2 -mindirect-branch=keep -fcf-protection -mcet -fcheck-pointer-bounds -mmpx" } */
+/* { dg-options "-O2 -mindirect-branch=keep -fcf-protection -fcheck-pointer-bounds -mmpx" } */
__attribute__ ((indirect_branch("thunk-inline")))
void
/* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=keep -fcf-protection -mcet" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=keep -fcf-protection" } */
extern void (*bar) (void);
/* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mindirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=keep -fcf-protection -mcet" } */
+/* { dg-options "-O2 -mindirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=keep -fcf-protection" } */
extern void (*bar) (void);
/* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mindirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=keep -fcf-protection -mcet" } */
+/* { dg-options "-O2 -mindirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=keep -fcf-protection" } */
extern void (*bar) (void) __attribute__((nocf_check));
/* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mindirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=thunk-extern -fcf-protection -mcet" } */
+/* { dg-options "-O2 -mindirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=thunk-extern -fcf-protection" } */
extern void (*bar) (void) __attribute__((nocf_check));
/* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=thunk-extern -fcf-protection -mcet" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=thunk-extern -fcf-protection" } */
extern void (*bar) (void);
/* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mindirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=thunk-extern -fcf-protection -mcet" } */
+/* { dg-options "-O2 -mindirect-branch-register -mfunction-return=keep -fno-pic -fplt -mindirect-branch=thunk-extern -fcf-protection" } */
extern void (*bar) (void);
/* { dg-do compile } */
-/* { dg-options "-O2 -fcf-protection -mcet" } */
+/* { dg-options "-O2 -fcf-protection" } */
/* { dg-final { scan-assembler-times {\mendbr} 1 } } */
extern int x;
/* { dg-do compile } */
-/* { dg-options "-O2 -fcf-protection -mcet" } */
+/* { dg-options "-O2 -fcf-protection" } */
/* { dg-final { scan-assembler-times {\mendbr} 2 } } */
extern int x;
/* { dg-do compile } */
-/* { dg-options "-O2 -fcf-protection -mcet" } */
+/* { dg-options "-O2 -fcf-protection" } */
/* { dg-final { scan-assembler-times {\mendbr} 2 } } */
extern int x;
/* { dg-do compile } */
-/* { dg-options "-O2 -fcf-protection -mcet" } */
+/* { dg-options "-O2 -fcf-protection" } */
/* { dg-final { scan-assembler-times {\mendbr} 2 } } */
static void
/* { dg-do compile } */
-/* { dg-options "-O2 -fcf-protection -mcet" } */
+/* { dg-options "-O2 -fcf-protection" } */
/* { dg-final { scan-assembler-times {\mendbr} 1 } } */
static void
/* { dg-do compile } */
-/* { dg-options "-O2 -fcf-protection -mcet" } */
+/* { dg-options "-O2 -fcf-protection" } */
/* { dg-final { scan-assembler-times {\mendbr} 2 } } */
extern int x;
/* PR target/84146 */
/* { dg-do compile } */
-/* { dg-options "-O2 -g -mcet -fcf-protection=full -fcompare-debug" } */
+/* { dg-options "-O2 -g -fcf-protection=full -fcompare-debug" } */
int __setjmp (void **);
void *buf[64];
/* { dg-do compile } */
-/* { dg-options "-fcf-protection -mcet" } */
+/* { dg-options "-fcf-protection" } */
/* { dg-require-ifunc "" } */
__attribute__((target_clones("avx","arch=slm","arch=core-avx2","default")))
/* { dg-do assemble { target cet } } */
-/* { dg-options "-fleading-underscore -mcet -fcf-protection" } */
+/* { dg-options "-fleading-underscore -fcf-protection" } */
void func(void) __asm("_func");
void _func(int x) {}