Hi! On 2020-04-23T09:15:29+0100, Andrew Stubbs <[email protected]> wrote: > On 22/04/2020 22:10, Kwok Cheung Yeung wrote: >> 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
So we should simply disable it properly (see below)... >> (the unwind functions are all stubs too), so >> adding an extra stub function does not regress the current level of >> functionality any. ... instead of adding such stub functions. >> 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 That's <https://gcc.gnu.org/PR94282> "[amdgcn] ld: error: undefined symbol: __gxx_personality_v0", by the way, so should be referenced in the ChangeLog. >> Tested with offloaded and standalone builds of GCC for AMD GCN. Okay for >> trunk? >> libgcc/ >> * config/gcn/unwind-gcn.c (__gxx_personality_v0): New. >> --- a/libgcc/config/gcn/unwind-gcn.c >> +++ b/libgcc/config/gcn/unwind-gcn.c >> +_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; >> +} What does a 'return 0' semantically mean here? Shouldn't this rather return some '_URC_*' code -- or even abort (given that we're not supporting unwinding)? > OK. I suggest we instead apply what I'd proposed a month ago in <https://gcc.gnu.org/PR94282> "[amdgcn] ld: error: undefined symbol: __gxx_personality_v0", and now yesterday (coincidentally) posted. +static enum unwind_info_type +gcn_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED) +{ + return UI_NONE; +} +#undef TARGET_EXCEPT_UNWIND_INFO +#define TARGET_EXCEPT_UNWIND_INFO gcn_except_unwind_info Grüße Thomas ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
