]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
GCN, nvptx: 'sorry, unimplemented: exception handling not supported'
authorThomas Schwinge <tschwinge@baylibre.com>
Tue, 28 Jan 2025 13:57:21 +0000 (14:57 +0100)
committerThomas Schwinge <tschwinge@baylibre.com>
Sat, 8 Feb 2025 11:37:07 +0000 (12:37 +0100)
For GCN, this avoids ICEs further down the compilation pipeline.  For nvptx,
there's effectively no change: in presence of exception handling constructs,
instead of 'sorry, unimplemented: target cannot support nonlocal goto', we
now emit 'sorry, unimplemented: exception handling not supported'.

Additionally, turn test cases into UNSUPPORTED if running into
'sorry, unimplemented: exception handling not supported'.

gcc/
* config/gcn/gcn.md (exception_receiver): 'define_expand'.
* config/nvptx/nvptx.md (exception_receiver): Likewise.
gcc/testsuite/
* lib/gcc-dg.exp (gcc-dg-prune): Turn
'sorry, unimplemented: exception handling not supported' into
UNSUPPORTED.
* gcc.dg/pr104464.c: Remove GCN XFAIL.
libstdc++-v3/
* testsuite/lib/prune.exp (libstdc++-dg-prune): Turn
'sorry, unimplemented: exception handling not supported' into
UNSUPPORTED.

gcc/config/gcn/gcn.md
gcc/config/nvptx/nvptx.md
gcc/testsuite/gcc.dg/pr104464.c
gcc/testsuite/lib/gcc-dg.exp
libstdc++-v3/testsuite/lib/prune.exp

index 9dddfca742b4d468fcf3bbbf94d3ce12eed70e7e..695656f692d6eadd6f9aec50468c5f34d2e8794b 100644 (file)
   [(set_attr "type" "sopp")
    (set_attr "length" "4")])
 
+(define_expand "exception_receiver"
+  [(const_int 0)]
+  ""
+{
+  sorry ("exception handling not supported");
+})
+
 ;; }}}
 ;; {{{ Conditionals
 
index a22a088fb3ac68633ed09dff484645b016b6618d..d3d538070c0fef3b8128dc238c0980c6a439739f 100644 (file)
   DONE;
 })
 
+(define_expand "exception_receiver"
+  [(const_int 0)]
+  ""
+{
+  sorry ("exception handling not supported");
+})
+
 (define_expand "nonlocal_goto"
   [(match_operand 0 "" "")
    (match_operand 1 "" "")
index d36a28678cb6f52fd3fb3aeb1460ece21e24b458..ed6a22c39d5e6e1a8328a70fe1d24f9df16d3b66 100644 (file)
@@ -9,5 +9,3 @@ foo(void)
 {
   f += (F)(f != (F){}[0]);
 }
-
-/* { dg-xfail-if "-fnon-call-exceptions unsupported" { amdgcn-*-* } } */
index 07a996a446697934c8131b4e3168bde22daa84cb..70be7a8d5fd1c2a0aa6dd1638eabce14482cc282 100644 (file)
@@ -434,6 +434,13 @@ proc gcc-dg-prune { system text } {
        return "::unsupported::large return values"
     }
 
+    # If exception handling is not supported, expectant tests are UNSUPPORTED.
+    if { ![check_effective_target_exceptions] } {
+       if [regexp "(^|\n)\[^\n\]*: sorry, unimplemented: exception handling not supported" $text] {
+           return "::unsupported::exception handling not supported"
+       }
+    }
+
     # If exception handling is disabled, expectant tests are UNSUPPORTED.
     if { ![check_effective_target_exceptions_enabled] } {
        if [regexp "(^|\n)\[^\n\]*: error: exception handling disabled" $text] {
index 593b74985fbef2c18db50d211fd12b6e79687254..566572baa6da944500ffa40e9f817b02ee3210d7 100644 (file)
@@ -89,6 +89,13 @@ proc libstdc++-dg-prune { system text } {
     # the single uncapitalized "in function" line.
     regsub -all "(^|\n)\[^\n\]*: in function\[^\n\]*" $text "" text
 
+    # If exception handling is not supported, expectant tests are UNSUPPORTED.
+    if { ![check_effective_target_exceptions] } {
+       if [regexp "(^|\n)\[^\n\]*: sorry, unimplemented: exception handling not supported" $text] {
+           return "::unsupported::exception handling not supported"
+       }
+    }
+
     # If exception handling is disabled, expectant tests are UNSUPPORTED.
     if { ![check_effective_target_exceptions_enabled] } {
        if [regexp "(^|\n)\[^\n\]*: error: exception handling disabled" $text] {