From 3f21b8e3f7be32dd2b3624a2ece12f84bed545bb Mon Sep 17 00:00:00 2001 From: Andrew Stubbs <ams@codesourcery.com> Date: Thu, 17 Jan 2019 12:35:28 +0000 Subject: [PATCH] Add dg-require-effective-target exceptions There are a number of tests that fail because they assume that exceptions are available, but GCN does not support them, yet. This patch adds "dg-require-effective-target exceptions" in all the affected tests. There's probably an automatic way to test for exceptions, but the current implementation simply says that AMD GCN does not support them. This should ensure that no other targets are affected by the change. 2019-01-17 Andrew Stubbs <ams@codesourcery.com> Kwok Cheung Yeung <kcy@codesourcery.com> Julian Brown <julian@codesourcery.com> Tom de Vries <tom@codesourcery.com> gcc/ * doc/sourcebuild.texi: Document dg-required-effective-target exceptions. gcc/testsuite/ * c-c++-common/ubsan/pr71512-1.c: Require exceptions. * c-c++-common/ubsan/pr71512-2.c: Require exceptions. * gcc.c-torture/compile/pr34648.c: Require exceptions. * gcc.c-torture/compile/pr41469.c: Require exceptions. * gcc.dg/20111216-1.c: Require exceptions. * gcc.dg/cleanup-10.c: Require exceptions. * gcc.dg/cleanup-11.c: Require exceptions. * gcc.dg/cleanup-12.c: Require exceptions. * gcc.dg/cleanup-13.c: Require exceptions. * gcc.dg/cleanup-5.c: Require exceptions. * gcc.dg/cleanup-8.c: Require exceptions. * gcc.dg/cleanup-9.c: Require exceptions. * gcc.dg/gomp/pr29955.c: Require exceptions. * gcc.dg/lto/pr52097_0.c: Require exceptions. * gcc.dg/nested-func-5.c: Require exceptions. * gcc.dg/pch/except-1.c: Require exceptions. * gcc.dg/pch/valid-2.c: Require exceptions. * gcc.dg/pr41470.c: Require exceptions. * gcc.dg/pr42427.c: Require exceptions. * gcc.dg/pr44545.c: Require exceptions. * gcc.dg/pr47086.c: Require exceptions. * gcc.dg/pr51481.c: Require exceptions. * gcc.dg/pr51644.c: Require exceptions. * gcc.dg/pr52046.c: Require exceptions. * gcc.dg/pr54669.c: Require exceptions. * gcc.dg/pr56424.c: Require exceptions. * gcc.dg/pr64465.c: Require exceptions. * gcc.dg/pr65802.c: Require exceptions. * gcc.dg/pr67563.c: Require exceptions. * gcc.dg/tree-ssa/pr41469-1.c: Require exceptions. * gcc.dg/tree-ssa/ssa-dse-28.c: Require exceptions. * gcc.dg/vect/pr46663.c: Require exceptions. * lib/target-supports.exp (check_effective_target_exceptions): New. Co-Authored-By: Julian Brown <julian@codesourcery.com> Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com> Co-Authored-By: Tom de Vries <tom@codesourcery.com> From-SVN: r268025 --- gcc/ChangeLog | 8 ++++ gcc/doc/sourcebuild.texi | 3 ++ gcc/testsuite/ChangeLog | 39 +++++++++++++++++++ gcc/testsuite/c-c++-common/ubsan/pr71512-1.c | 1 + gcc/testsuite/c-c++-common/ubsan/pr71512-2.c | 1 + gcc/testsuite/gcc.c-torture/compile/pr34648.c | 1 + gcc/testsuite/gcc.c-torture/compile/pr41469.c | 1 + gcc/testsuite/gcc.dg/20111216-1.c | 1 + gcc/testsuite/gcc.dg/cleanup-10.c | 1 + gcc/testsuite/gcc.dg/cleanup-11.c | 1 + gcc/testsuite/gcc.dg/cleanup-12.c | 1 + gcc/testsuite/gcc.dg/cleanup-13.c | 1 + gcc/testsuite/gcc.dg/cleanup-5.c | 1 + gcc/testsuite/gcc.dg/cleanup-8.c | 1 + gcc/testsuite/gcc.dg/cleanup-9.c | 1 + gcc/testsuite/gcc.dg/gomp/pr29955.c | 1 + gcc/testsuite/gcc.dg/lto/pr52097_0.c | 1 + gcc/testsuite/gcc.dg/nested-func-5.c | 1 + gcc/testsuite/gcc.dg/pch/except-1.c | 1 + gcc/testsuite/gcc.dg/pch/valid-2.c | 2 +- gcc/testsuite/gcc.dg/pr41470.c | 1 + gcc/testsuite/gcc.dg/pr42427.c | 1 + gcc/testsuite/gcc.dg/pr44545.c | 1 + gcc/testsuite/gcc.dg/pr47086.c | 1 + gcc/testsuite/gcc.dg/pr51481.c | 1 + gcc/testsuite/gcc.dg/pr51644.c | 1 + gcc/testsuite/gcc.dg/pr52046.c | 1 + gcc/testsuite/gcc.dg/pr54669.c | 1 + gcc/testsuite/gcc.dg/pr56424.c | 1 + gcc/testsuite/gcc.dg/pr64465.c | 1 + gcc/testsuite/gcc.dg/pr65802.c | 1 + gcc/testsuite/gcc.dg/pr67563.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/pr41469-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-28.c | 1 + gcc/testsuite/gcc.dg/vect/pr46663.c | 1 + gcc/testsuite/lib/target-supports.exp | 10 +++++ 36 files changed, 92 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4cc44d7279cd..2a4130e9193d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-01-17 Andrew Stubbs <ams@codesourcery.com> + Kwok Cheung Yeung <kcy@codesourcery.com> + Julian Brown <julian@codesourcery.com> + Tom de Vries <tom@codesourcery.com> + + * doc/sourcebuild.texi: Document dg-required-effective-target + exceptions. + 2019-01-17 Andrew Stubbs <ams@codesourcery.com> Kwok Cheung Yeung <kcy@codesourcery.com> Julian Brown <julian@codesourcery.com> diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 1970f44d6dcd..c93a516f9662 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2228,6 +2228,9 @@ Target uses @code{__cxa_atexit}. @item default_packed Target has packed layout of structure members by default. +@item exceptions +Target supports exceptions. + @item fgraphite Target supports Graphite optimizations. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 632da85dfbeb..c4e1dd5db703 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,42 @@ +2019-01-17 Andrew Stubbs <ams@codesourcery.com> + Kwok Cheung Yeung <kcy@codesourcery.com> + Julian Brown <julian@codesourcery.com> + Tom de Vries <tom@codesourcery.com> + + * c-c++-common/ubsan/pr71512-1.c: Require exceptions. + * c-c++-common/ubsan/pr71512-2.c: Require exceptions. + * gcc.c-torture/compile/pr34648.c: Require exceptions. + * gcc.c-torture/compile/pr41469.c: Require exceptions. + * gcc.dg/20111216-1.c: Require exceptions. + * gcc.dg/cleanup-10.c: Require exceptions. + * gcc.dg/cleanup-11.c: Require exceptions. + * gcc.dg/cleanup-12.c: Require exceptions. + * gcc.dg/cleanup-13.c: Require exceptions. + * gcc.dg/cleanup-5.c: Require exceptions. + * gcc.dg/cleanup-8.c: Require exceptions. + * gcc.dg/cleanup-9.c: Require exceptions. + * gcc.dg/gomp/pr29955.c: Require exceptions. + * gcc.dg/lto/pr52097_0.c: Require exceptions. + * gcc.dg/nested-func-5.c: Require exceptions. + * gcc.dg/pch/except-1.c: Require exceptions. + * gcc.dg/pch/valid-2.c: Require exceptions. + * gcc.dg/pr41470.c: Require exceptions. + * gcc.dg/pr42427.c: Require exceptions. + * gcc.dg/pr44545.c: Require exceptions. + * gcc.dg/pr47086.c: Require exceptions. + * gcc.dg/pr51481.c: Require exceptions. + * gcc.dg/pr51644.c: Require exceptions. + * gcc.dg/pr52046.c: Require exceptions. + * gcc.dg/pr54669.c: Require exceptions. + * gcc.dg/pr56424.c: Require exceptions. + * gcc.dg/pr64465.c: Require exceptions. + * gcc.dg/pr65802.c: Require exceptions. + * gcc.dg/pr67563.c: Require exceptions. + * gcc.dg/tree-ssa/pr41469-1.c: Require exceptions. + * gcc.dg/tree-ssa/ssa-dse-28.c: Require exceptions. + * gcc.dg/vect/pr46663.c: Require exceptions. + * lib/target-supports.exp (check_effective_target_exceptions): New. + 2019-01-17 Tamar Christina <tamar.christina@arm.com> PR target/88851 diff --git a/gcc/testsuite/c-c++-common/ubsan/pr71512-1.c b/gcc/testsuite/c-c++-common/ubsan/pr71512-1.c index 2a90ab18d517..8af93656d91d 100644 --- a/gcc/testsuite/c-c++-common/ubsan/pr71512-1.c +++ b/gcc/testsuite/c-c++-common/ubsan/pr71512-1.c @@ -1,5 +1,6 @@ /* PR c/71512 */ /* { dg-do compile } */ /* { dg-options "-O2 -fnon-call-exceptions -ftrapv -fexceptions -fsanitize=undefined" } */ +/* { dg-require-effective-target exceptions } */ #include "../../gcc.dg/pr44545.c" diff --git a/gcc/testsuite/c-c++-common/ubsan/pr71512-2.c b/gcc/testsuite/c-c++-common/ubsan/pr71512-2.c index 1c955930be83..0c1693488cad 100644 --- a/gcc/testsuite/c-c++-common/ubsan/pr71512-2.c +++ b/gcc/testsuite/c-c++-common/ubsan/pr71512-2.c @@ -1,5 +1,6 @@ /* PR c/71512 */ /* { dg-do compile } */ /* { dg-options "-O -fexceptions -fnon-call-exceptions -ftrapv -fsanitize=undefined" } */ +/* { dg-require-effective-target exceptions } */ #include "../../gcc.dg/pr47086.c" diff --git a/gcc/testsuite/gcc.c-torture/compile/pr34648.c b/gcc/testsuite/gcc.c-torture/compile/pr34648.c index 8bcdae0501af..90a88b90361f 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr34648.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr34648.c @@ -1,6 +1,7 @@ /* PR tree-optimization/34648 */ /* { dg-options "-fexceptions" } */ +/* { dg-require-effective-target exceptions } */ extern const unsigned short int **bar (void) __attribute__ ((const)); const char *a; diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41469.c b/gcc/testsuite/gcc.c-torture/compile/pr41469.c index 5917794cc346..923bca2f8485 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr41469.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr41469.c @@ -1,5 +1,6 @@ /* { dg-options "-fexceptions" } */ /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */ +/* { dg-require-effective-target exceptions } */ void af (void *a) diff --git a/gcc/testsuite/gcc.dg/20111216-1.c b/gcc/testsuite/gcc.dg/20111216-1.c index cd82cf929849..7f9395e41e51 100644 --- a/gcc/testsuite/gcc.dg/20111216-1.c +++ b/gcc/testsuite/gcc.dg/20111216-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O -fexceptions -fnon-call-exceptions" } */ +/* { dg-require-effective-target exceptions } */ extern void f2 () __attribute__ ((noreturn)); void diff --git a/gcc/testsuite/gcc.dg/cleanup-10.c b/gcc/testsuite/gcc.dg/cleanup-10.c index 16035b1ca437..1af63ea6eafe 100644 --- a/gcc/testsuite/gcc.dg/cleanup-10.c +++ b/gcc/testsuite/gcc.dg/cleanup-10.c @@ -1,5 +1,6 @@ /* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ +/* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through signal frames on alternate stack. */ diff --git a/gcc/testsuite/gcc.dg/cleanup-11.c b/gcc/testsuite/gcc.dg/cleanup-11.c index ccc61ed41b87..c1f19fe2cf94 100644 --- a/gcc/testsuite/gcc.dg/cleanup-11.c +++ b/gcc/testsuite/gcc.dg/cleanup-11.c @@ -1,5 +1,6 @@ /* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ +/* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through realtime signal frames on alternate stack. */ diff --git a/gcc/testsuite/gcc.dg/cleanup-12.c b/gcc/testsuite/gcc.dg/cleanup-12.c index efb9a58ce8a2..2171e35de9da 100644 --- a/gcc/testsuite/gcc.dg/cleanup-12.c +++ b/gcc/testsuite/gcc.dg/cleanup-12.c @@ -4,6 +4,7 @@ /* { dg-options "-O2 -fexceptions" } */ /* { dg-skip-if "" { "ia64-*-hpux11.*" } } */ /* { dg-skip-if "" { ! nonlocal_goto } } */ +/* { dg-require-effective-target exceptions } */ /* Verify unwind info in presence of alloca. */ #include <unwind.h> diff --git a/gcc/testsuite/gcc.dg/cleanup-13.c b/gcc/testsuite/gcc.dg/cleanup-13.c index 8a8db277dd64..1b7ea5c4b284 100644 --- a/gcc/testsuite/gcc.dg/cleanup-13.c +++ b/gcc/testsuite/gcc.dg/cleanup-13.c @@ -3,6 +3,7 @@ /* { dg-options "-fexceptions" } */ /* { dg-skip-if "" { "ia64-*-hpux11.*" } } */ /* { dg-skip-if "" { ! nonlocal_goto } } */ +/* { dg-require-effective-target exceptions } */ /* Verify DW_OP_* handling in the unwinder. */ #include <unwind.h> diff --git a/gcc/testsuite/gcc.dg/cleanup-5.c b/gcc/testsuite/gcc.dg/cleanup-5.c index 4257f9e0398b..9ed2a7c95f5f 100644 --- a/gcc/testsuite/gcc.dg/cleanup-5.c +++ b/gcc/testsuite/gcc.dg/cleanup-5.c @@ -3,6 +3,7 @@ /* { dg-options "-fexceptions" } */ /* { dg-skip-if "" { "ia64-*-hpux11.*" } } */ /* { dg-skip-if "" { ! nonlocal_goto } } */ +/* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling. */ #include <unwind.h> diff --git a/gcc/testsuite/gcc.dg/cleanup-8.c b/gcc/testsuite/gcc.dg/cleanup-8.c index 553c0385d5d2..45abdb2a0503 100644 --- a/gcc/testsuite/gcc.dg/cleanup-8.c +++ b/gcc/testsuite/gcc.dg/cleanup-8.c @@ -1,5 +1,6 @@ /* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ +/* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through signal frames. */ diff --git a/gcc/testsuite/gcc.dg/cleanup-9.c b/gcc/testsuite/gcc.dg/cleanup-9.c index fe2807234c24..98dc268e50d9 100644 --- a/gcc/testsuite/gcc.dg/cleanup-9.c +++ b/gcc/testsuite/gcc.dg/cleanup-9.c @@ -1,5 +1,6 @@ /* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ +/* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through realtime signal frames. */ diff --git a/gcc/testsuite/gcc.dg/gomp/pr29955.c b/gcc/testsuite/gcc.dg/gomp/pr29955.c index e49c11cae1dd..102898c83936 100644 --- a/gcc/testsuite/gcc.dg/gomp/pr29955.c +++ b/gcc/testsuite/gcc.dg/gomp/pr29955.c @@ -1,6 +1,7 @@ /* PR c/29955 */ /* { dg-do compile } */ /* { dg-options "-O2 -fopenmp -fexceptions" } */ +/* { dg-require-effective-target exceptions } */ extern void bar (int); diff --git a/gcc/testsuite/gcc.dg/lto/pr52097_0.c b/gcc/testsuite/gcc.dg/lto/pr52097_0.c index cd4af5d1f299..1b3fda3b9113 100644 --- a/gcc/testsuite/gcc.dg/lto/pr52097_0.c +++ b/gcc/testsuite/gcc.dg/lto/pr52097_0.c @@ -1,5 +1,6 @@ /* { dg-lto-do link } */ /* { dg-lto-options { { -O -flto -fexceptions -fnon-call-exceptions --param allow-store-data-races=0 } } } */ +/* { dg-require-effective-target exceptions } */ typedef struct { unsigned int e0 : 16; } s1; typedef struct { unsigned int e0 : 16; } s2; diff --git a/gcc/testsuite/gcc.dg/nested-func-5.c b/gcc/testsuite/gcc.dg/nested-func-5.c index 3545f37e5cc1..591f8a2c1a99 100644 --- a/gcc/testsuite/gcc.dg/nested-func-5.c +++ b/gcc/testsuite/gcc.dg/nested-func-5.c @@ -2,6 +2,7 @@ /* { dg-options "-fexceptions" } */ /* PR28516: ICE generating ARM unwind directives for nested functions. */ /* { dg-require-effective-target trampolines } */ +/* { dg-require-effective-target exceptions } */ void ex(int (*)(void)); void foo(int i) diff --git a/gcc/testsuite/gcc.dg/pch/except-1.c b/gcc/testsuite/gcc.dg/pch/except-1.c index f81b098d7d88..30350edbd396 100644 --- a/gcc/testsuite/gcc.dg/pch/except-1.c +++ b/gcc/testsuite/gcc.dg/pch/except-1.c @@ -1,4 +1,5 @@ /* { dg-options "-fexceptions -I." } */ +/* { dg-require-effective-target exceptions } */ #include "except-1.h" int main(void) diff --git a/gcc/testsuite/gcc.dg/pch/valid-2.c b/gcc/testsuite/gcc.dg/pch/valid-2.c index 3d8cb1427f36..15a57c9077e4 100644 --- a/gcc/testsuite/gcc.dg/pch/valid-2.c +++ b/gcc/testsuite/gcc.dg/pch/valid-2.c @@ -1,5 +1,5 @@ /* { dg-options "-I. -Winvalid-pch -fexceptions" } */ - +/* { dg-require-effective-target exceptions } */ #include "valid-2.h" /* { dg-warning "settings for -fexceptions do not match" } */ /* { dg-error "No such file" "no such file" { target *-*-* } 0 } */ /* { dg-error "they were invalid" "invalid files" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/pr41470.c b/gcc/testsuite/gcc.dg/pr41470.c index 7ef008615239..7374facea0ff 100644 --- a/gcc/testsuite/gcc.dg/pr41470.c +++ b/gcc/testsuite/gcc.dg/pr41470.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-fexceptions" } */ /* { dg-require-effective-target alloca } */ +/* { dg-require-effective-target exceptions } */ void cf (void *); diff --git a/gcc/testsuite/gcc.dg/pr42427.c b/gcc/testsuite/gcc.dg/pr42427.c index cb43dd2affba..cb290fea3f19 100644 --- a/gcc/testsuite/gcc.dg/pr42427.c +++ b/gcc/testsuite/gcc.dg/pr42427.c @@ -2,6 +2,7 @@ /* { dg-options "-O2 -fexceptions -fnon-call-exceptions -fpeel-loops" } */ /* { dg-add-options c99_runtime } */ /* { dg-require-effective-target ilp32 } */ +/* { dg-require-effective-target exceptions } */ #include <complex.h> diff --git a/gcc/testsuite/gcc.dg/pr44545.c b/gcc/testsuite/gcc.dg/pr44545.c index 8058261f850f..37f75f16f999 100644 --- a/gcc/testsuite/gcc.dg/pr44545.c +++ b/gcc/testsuite/gcc.dg/pr44545.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fnon-call-exceptions -ftrapv -fexceptions" } */ +/* { dg-require-effective-target exceptions } */ void DrawChunk(int *tabSize, int x) { diff --git a/gcc/testsuite/gcc.dg/pr47086.c b/gcc/testsuite/gcc.dg/pr47086.c index 71743fe4fe5c..473e802bc1f7 100644 --- a/gcc/testsuite/gcc.dg/pr47086.c +++ b/gcc/testsuite/gcc.dg/pr47086.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O -fexceptions -fnon-call-exceptions -ftrapv" } */ +/* { dg-require-effective-target exceptions } */ void foo () diff --git a/gcc/testsuite/gcc.dg/pr51481.c b/gcc/testsuite/gcc.dg/pr51481.c index d883d475cfcf..a35f8f387510 100644 --- a/gcc/testsuite/gcc.dg/pr51481.c +++ b/gcc/testsuite/gcc.dg/pr51481.c @@ -1,6 +1,7 @@ /* PR tree-optimization/51481 */ /* { dg-do compile } */ /* { dg-options "-O -fexceptions -fipa-cp -fipa-cp-clone" } */ +/* { dg-require-effective-target exceptions } */ extern const unsigned short int **foo (void) __attribute__ ((__nothrow__, __const__)); diff --git a/gcc/testsuite/gcc.dg/pr51644.c b/gcc/testsuite/gcc.dg/pr51644.c index 2038a0c4b930..e23c02f9fd6a 100644 --- a/gcc/testsuite/gcc.dg/pr51644.c +++ b/gcc/testsuite/gcc.dg/pr51644.c @@ -1,6 +1,7 @@ /* PR middle-end/51644 */ /* { dg-do compile } */ /* { dg-options "-Wall -fexceptions" } */ +/* { dg-require-effective-target exceptions } */ #include <stdarg.h> diff --git a/gcc/testsuite/gcc.dg/pr52046.c b/gcc/testsuite/gcc.dg/pr52046.c index e72061f9908e..f0873e2008ff 100644 --- a/gcc/testsuite/gcc.dg/pr52046.c +++ b/gcc/testsuite/gcc.dg/pr52046.c @@ -1,6 +1,7 @@ /* PR tree-optimization/52046 */ /* { dg-do compile } */ /* { dg-options "-O3 -fexceptions -fnon-call-exceptions" } */ +/* { dg-require-effective-target exceptions } */ extern float a[], b[], c[], d[]; extern int k[]; diff --git a/gcc/testsuite/gcc.dg/pr54669.c b/gcc/testsuite/gcc.dg/pr54669.c index b68c0476a495..48967ed5da2a 100644 --- a/gcc/testsuite/gcc.dg/pr54669.c +++ b/gcc/testsuite/gcc.dg/pr54669.c @@ -3,6 +3,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fexceptions -fnon-call-exceptions" } */ +/* { dg-require-effective-target exceptions } */ int a[10]; diff --git a/gcc/testsuite/gcc.dg/pr56424.c b/gcc/testsuite/gcc.dg/pr56424.c index a724c640e993..7f28f044710f 100644 --- a/gcc/testsuite/gcc.dg/pr56424.c +++ b/gcc/testsuite/gcc.dg/pr56424.c @@ -2,6 +2,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fexceptions -fnon-call-exceptions" } */ +/* { dg-require-effective-target exceptions } */ extern long double cosl (long double); extern long double sinl (long double); diff --git a/gcc/testsuite/gcc.dg/pr64465.c b/gcc/testsuite/gcc.dg/pr64465.c index acfa952b00c2..d1d17493acc9 100644 --- a/gcc/testsuite/gcc.dg/pr64465.c +++ b/gcc/testsuite/gcc.dg/pr64465.c @@ -1,6 +1,7 @@ /* PR tree-optimization/64465 */ /* { dg-do compile } */ /* { dg-options "-O2 -fexceptions" } */ +/* { dg-require-effective-target exceptions } */ extern int foo (int *); extern int bar (int, int); diff --git a/gcc/testsuite/gcc.dg/pr65802.c b/gcc/testsuite/gcc.dg/pr65802.c index fcec234dc0b8..0721ca81bf65 100644 --- a/gcc/testsuite/gcc.dg/pr65802.c +++ b/gcc/testsuite/gcc.dg/pr65802.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O0 -fexceptions" } */ +/* { dg-require-effective-target exceptions } */ #include <stdarg.h> diff --git a/gcc/testsuite/gcc.dg/pr67563.c b/gcc/testsuite/gcc.dg/pr67563.c index 34a78a23a939..5a727b832fb4 100644 --- a/gcc/testsuite/gcc.dg/pr67563.c +++ b/gcc/testsuite/gcc.dg/pr67563.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fexceptions" } */ +/* { dg-require-effective-target exceptions } */ static void emit_package (int p1) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr41469-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr41469-1.c index 6be7cd965575..eb8e1f255162 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr41469-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr41469-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fexceptions -fdump-tree-optimized" } */ +/* { dg-require-effective-target exceptions } */ void af (void *a); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-28.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-28.c index d35377ba96b7..d3a1bbc5ce53 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-28.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-28.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-dse-details -fexceptions -fnon-call-exceptions -fno-isolate-erroneous-paths-dereference" } */ +/* { dg-require-effective-target exceptions } */ int foo (int *p, int b) diff --git a/gcc/testsuite/gcc.dg/vect/pr46663.c b/gcc/testsuite/gcc.dg/vect/pr46663.c index 457ceae6a577..c2e56bb253a7 100644 --- a/gcc/testsuite/gcc.dg/vect/pr46663.c +++ b/gcc/testsuite/gcc.dg/vect/pr46663.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-additional-options "-O -fexceptions" } */ +/* { dg-require-effective-target exceptions } */ typedef __attribute__ ((const)) int (*bart) (void); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 88fbc8d7fe4c..cc6e2bb4c377 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8510,6 +8510,16 @@ proc check_effective_target_fenv_exceptions {} { } [add_options_for_ieee "-std=gnu99"]] } +# Return 1 if -fexceptions is supported. + +proc check_effective_target_exceptions {} { + if { [istarget amdgcn*-*-*] } { + return 0 + } + return 1 +} + + proc check_effective_target_tiny {} { return [check_cached_effective_target tiny { if { [istarget aarch64*-*-*] -- GitLab