Hello

This patch adds a stub implementation of __gxx_personality_v0, which is used in C++ exception handling. AMD GCN currently does not actually support exception handling (the unwind functions are all stubs too), so adding an extra stub function does not regress the current level of functionality any. This allows the following tests in the libgomp testsuite that were previously failing with a linker error to compile and run, provided that they do not throw any exceptions:

libgomp.c-c++-common/function-not-offloaded.c
libgomp.c++/for-15.C
libgomp.c++/for-24.C
libgomp.oacc-c-c++-common/routine-1.c
libgomp.oacc-c++/pr71959.C
libgomp.oacc-c++/routine-1-auto.C
libgomp.oacc-c++/routine-1-template-auto.C
libgomp.oacc-c++/routine-1-template-trailing-return-type.C
libgomp.oacc-c++/routine-1-template.C
libgomp.oacc-c++/routine-1-trailing-return-type.C

Tested with offloaded and standalone builds of GCC for AMD GCN. Okay for trunk?

Kwok

2020-04-22  Kwok Cheung Yeung  <k...@codesourcery.com>

        libgcc/
        * config/gcn/unwind-gcn.c (__gxx_personality_v0): New.

diff --git a/libgcc/config/gcn/unwind-gcn.c b/libgcc/config/gcn/unwind-gcn.c
index 813f03f..6508b45 100644
--- a/libgcc/config/gcn/unwind-gcn.c
+++ b/libgcc/config/gcn/unwind-gcn.c
@@ -35,3 +35,13 @@ _Unwind_GetIPInfo (struct _Unwind_Context *c, int *ip_before_insn)
 {
   return 0;
 }
+
+_Unwind_Reason_Code
+__gxx_personality_v0 (int version,
+                     _Unwind_Action actions,
+                     _Unwind_Exception_Class exception_class,
+                     struct _Unwind_Exception *ue_header,
+                     struct _Unwind_Context *context)
+{
+  return 0;
+}

Reply via email to