@@ -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.
@@ -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"
@@ -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"
@@ -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;
@@ -1,5 +1,6 @@
/* { dg-options "-fexceptions" } */
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
+/* { dg-require-effective-target exceptions } */
void
af (void *a)
@@ -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
@@ -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. */
@@ -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. */
@@ -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>
@@ -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>
@@ -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>
@@ -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. */
@@ -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. */
@@ -1,6 +1,7 @@
/* PR c/29955 */
/* { dg-do compile } */
/* { dg-options "-O2 -fopenmp -fexceptions" } */
+/* { dg-require-effective-target exceptions } */
extern void bar (int);
@@ -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;
@@ -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)
@@ -1,4 +1,5 @@
/* { dg-options "-fexceptions -I." } */
+/* { dg-require-effective-target exceptions } */
#include "except-1.h"
int main(void)
@@ -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 } */
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-fexceptions" } */
/* { dg-require-effective-target alloca } */
+/* { dg-require-effective-target exceptions } */
void cf (void *);
@@ -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>
@@ -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)
{
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O -fexceptions -fnon-call-exceptions -ftrapv" } */
+/* { dg-require-effective-target exceptions } */
void
foo ()
@@ -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__));
@@ -1,6 +1,7 @@
/* PR middle-end/51644 */
/* { dg-do compile } */
/* { dg-options "-Wall -fexceptions" } */
+/* { dg-require-effective-target exceptions } */
#include <stdarg.h>
@@ -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[];
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fexceptions -fnon-call-exceptions" } */
+/* { dg-require-effective-target exceptions } */
int a[10];
@@ -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);
@@ -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);
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O0 -fexceptions" } */
+/* { dg-require-effective-target exceptions } */
#include <stdarg.h>
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fexceptions" } */
+/* { dg-require-effective-target exceptions } */
static void
emit_package (int p1)
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fexceptions -fdump-tree-optimized" } */
+/* { dg-require-effective-target exceptions } */
void af (void *a);
@@ -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)
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-additional-options "-O -fexceptions" } */
+/* { dg-require-effective-target exceptions } */
typedef __attribute__ ((const)) int (*bart) (void);
@@ -8473,6 +8473,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*-*-*]