diff options
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 68 | ||||
-rw-r--r-- | libgcc/config/gcn/unwind-gcn.c | 27 | ||||
-rw-r--r-- | libgcc/config/i386/gthr-win32.h | 81 | ||||
-rw-r--r-- | libgcc/config/nvptx/alloca.c | 38 | ||||
-rw-r--r-- | libgcc/config/nvptx/t-nvptx | 3 | ||||
-rw-r--r-- | libgcc/config/nvptx/unwind-nvptx.c | 27 |
6 files changed, 208 insertions, 36 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index ebfb4e2..946bf13 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,71 @@ +2025-04-14 Thomas Schwinge <tschwinge@baylibre.com> + + PR target/118794 + * config/gcn/unwind-gcn.c (_Unwind_Resume): New. + * config/nvptx/unwind-nvptx.c (_Unwind_Resume): Likewise. + +2025-04-14 Eric Botcazou <ebotcazou@adacore.com> + + PR target/119673 + * config/i386/gthr-win32.h (__GTHREAD_ALWAYS_INLINE): New macro. + (__GTHREAD_INLINE): Likewise. + (__GTHR_W32_InterlockedCompareExchange): Delete. + (__gthread_active_p): Mark as __GTHREAD_INLINE instead of + static inline. + (__gthread_create): Likewise. + (__gthread_join): Likewise. + (__gthread_self): Likewise. + (__gthread_detach): Likewise. + (__gthread_equal): Likewise. + (__gthread_yield): Likewise. + (__gthread_once): Likewise. + (__gthread_key_create): Likewise. + (__gthread_key_delete): Likewise. + (__gthread_getspecific): Likewise. + (__gthread_setspecific): Likewise. + (__gthread_mutex_init_function): Likewise. + (__gthread_mutex_destroy): Likewise. + (__gthread_mutex_lock): Likewise. + (__gthread_mutex_trylock): Likewise. + (__gthread_mutex_timedlock): Likewise. + (__gthread_mutex_unlock): Likewise. + (__gthread_recursive_mutex_trylock): Likewise. + (__gthread_cond_init_function): Likewise. + (__gthread_cond_broadcast): Likewise. + (__gthread_cond_signal): Likewise. + (__gthread_cond_wait): Likewise. + (__gthread_cond_timedwait): Likewise. + (__GTHREAD_WIN32_INLINE): Likewise. + (__GTHREAD_WIN32_COND_INLINE): Likewise. + (__gthread_recursive_mutex_init_function): Likewise. + (__gthread_recursive_mutex_destroy): Likewise. + (__gthread_recursive_mutex_lock): Likewise. + (__gthread_recursive_mutex_unlock): Likewise. + (__gthread_cond_destroy): Likewise. + (__gthread_cond_wait_recursive): Likewise. + +2025-04-08 Thomas Schwinge <tschwinge@baylibre.com> + + * config/gcn/unwind-gcn.c (_Unwind_RaiseException) + (_Unwind_Resume_or_Rethrow): New. + * config/nvptx/unwind-nvptx.c (_Unwind_RaiseException) + (_Unwind_Resume_or_Rethrow): Likewise. + +2025-04-08 Thomas Schwinge <tschwinge@baylibre.com> + + * config/gcn/unwind-gcn.c (_Unwind_DeleteException): New. + * config/nvptx/unwind-nvptx.c (_Unwind_DeleteException): Likewise. + +2025-04-07 Thomas Schwinge <tschwinge@baylibre.com> + + * config/nvptx/alloca.c: New. + * config/nvptx/t-nvptx (LIB2ADD): Add it. + +2025-04-07 Georg-Johann Lay <avr@gjlay.de> + + * config/avr/lib1funcs.S (__mulhisi3, __umulhisi3): Use + __mulhisi3_helper for better performance on AVRrc. + 2025-04-06 Georg-Johann Lay <avr@gjlay.de> * config/avr/t-avr (LIB1ASMFUNCS): Add (and remove from diff --git a/libgcc/config/gcn/unwind-gcn.c b/libgcc/config/gcn/unwind-gcn.c index 44657ae..97e22c0 100644 --- a/libgcc/config/gcn/unwind-gcn.c +++ b/libgcc/config/gcn/unwind-gcn.c @@ -25,6 +25,33 @@ #include "unwind.h" _Unwind_Reason_Code +_Unwind_RaiseException(struct _Unwind_Exception *exc __attribute__ ((__unused__))) +{ + __builtin_abort (); + return 0; +} + +void +_Unwind_DeleteException (struct _Unwind_Exception *exc) +{ + if (exc->exception_cleanup) + (*exc->exception_cleanup) (_URC_FOREIGN_EXCEPTION_CAUGHT, exc); +} + +void +_Unwind_Resume (struct _Unwind_Exception *exc __attribute__ ((__unused__))) +{ + __builtin_abort (); +} + +_Unwind_Reason_Code +_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc __attribute__ ((__unused__))) +{ + __builtin_abort (); + return 0; +} + +_Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument) { return 0; diff --git a/libgcc/config/i386/gthr-win32.h b/libgcc/config/i386/gthr-win32.h index 98e11b4..34988d4 100644 --- a/libgcc/config/i386/gthr-win32.h +++ b/libgcc/config/i386/gthr-win32.h @@ -71,6 +71,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #error Timed lock primitives are not supported on Windows targets #endif +#ifdef __has_attribute +# if __has_attribute(__always_inline__) +# define __GTHREAD_ALWAYS_INLINE __attribute__((__always_inline__)) +# endif +#endif +#ifndef __GTHREAD_ALWAYS_INLINE +# define __GTHREAD_ALWAYS_INLINE +#endif + +#ifdef __cplusplus +# define __GTHREAD_INLINE inline __GTHREAD_ALWAYS_INLINE +#else +# define __GTHREAD_INLINE static inline +#endif + /* Make sure CONST_CAST2 (origin in system.h) is declared. */ #ifndef CONST_CAST2 #ifdef __cplusplus @@ -398,11 +413,7 @@ extern int _CRT_MT; extern int __mingwthr_key_dtor (unsigned long, void (*) (void *)); #endif /* _WIN32 && !__CYGWIN__ */ -/* __GTHR_W32_InterlockedCompareExchange is left over from win95, - which did not support InterlockedCompareExchange. */ -#define __GTHR_W32_InterlockedCompareExchange InterlockedCompareExchange - -static inline int +__GTHREAD_INLINE int __gthread_active_p (void) { #ifdef MINGW32_SUPPORTS_MT_EH @@ -438,20 +449,20 @@ extern int __gthr_win32_cond_timedwait (__gthread_cond_t *, __gthread_mutex_t *, const __gthread_time_t *); #endif -static inline int +__GTHREAD_INLINE int __gthread_create (__gthread_t *__thr, void *(*__func) (void*), void *__args) { return __gthr_win32_create (__thr, __func, __args); } -static inline int +__GTHREAD_INLINE int __gthread_join (__gthread_t __thr, void **__value_ptr) { return __gthr_win32_join (__thr, __value_ptr); } -static inline __gthread_t +__GTHREAD_INLINE __gthread_t __gthread_self (void) { return __gthr_win32_self (); @@ -463,25 +474,25 @@ __gthread_self (void) Only stubs are exposed to avoid polluting the C++ namespace with Win32 API definitions. */ -static inline int +__GTHREAD_INLINE int __gthread_detach (__gthread_t __thr) { return __gthr_win32_detach (__thr); } -static inline int +__GTHREAD_INLINE int __gthread_equal (__gthread_t __thr1, __gthread_t __thr2) { return __gthr_win32_equal (__thr1, __thr2); } -static inline int +__GTHREAD_INLINE int __gthread_yield (void) { return __gthr_win32_yield (); } -static inline int +__GTHREAD_INLINE int __gthread_once (__gthread_once_t *__once, void (*__func) (void)) { if (__gthread_active_p ()) @@ -490,43 +501,43 @@ __gthread_once (__gthread_once_t *__once, void (*__func) (void)) return -1; } -static inline int +__GTHREAD_INLINE int __gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *)) { return __gthr_win32_key_create (__key, __dtor); } -static inline int +__GTHREAD_INLINE int __gthread_key_delete (__gthread_key_t __key) { return __gthr_win32_key_delete (__key); } -static inline void * +__GTHREAD_INLINE void * __gthread_getspecific (__gthread_key_t __key) { return __gthr_win32_getspecific (__key); } -static inline int +__GTHREAD_INLINE int __gthread_setspecific (__gthread_key_t __key, const void *__ptr) { return __gthr_win32_setspecific (__key, __ptr); } -static inline void +__GTHREAD_INLINE void __gthread_mutex_init_function (__gthread_mutex_t *__mutex) { __gthr_win32_mutex_init_function (__mutex); } -static inline void +__GTHREAD_INLINE void __gthread_mutex_destroy (__gthread_mutex_t *__mutex) { __gthr_win32_mutex_destroy (__mutex); } -static inline int +__GTHREAD_INLINE int __gthread_mutex_lock (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) @@ -535,7 +546,7 @@ __gthread_mutex_lock (__gthread_mutex_t *__mutex) return 0; } -static inline int +__GTHREAD_INLINE int __gthread_mutex_trylock (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) @@ -544,7 +555,7 @@ __gthread_mutex_trylock (__gthread_mutex_t *__mutex) return 0; } -static inline int +__GTHREAD_INLINE int __gthread_mutex_unlock (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) @@ -553,7 +564,7 @@ __gthread_mutex_unlock (__gthread_mutex_t *__mutex) return 0; } -static inline int +__GTHREAD_INLINE int __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex) { if (__gthread_active_p ()) @@ -564,31 +575,31 @@ __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex) #if __GTHREAD_HAS_COND -static inline void +__GTHREAD_INLINE void __gthread_cond_init_function (__gthread_cond_t *__cond) { __gthr_win32_cond_init_function (__cond); } -static inline int +__GTHREAD_INLINE int __gthread_cond_broadcast (__gthread_cond_t *__cond) { return __gthr_win32_cond_broadcast (__cond); } -static inline int +__GTHREAD_INLINE int __gthread_cond_signal (__gthread_cond_t *__cond) { return __gthr_win32_cond_signal (__cond); } -static inline int +__GTHREAD_INLINE int __gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex) { return __gthr_win32_cond_wait (__cond, __mutex); } -static inline int +__GTHREAD_INLINE int __gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex, const __gthread_time_t *__abs_time) { @@ -600,11 +611,11 @@ __gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex, #else /* ! __GTHREAD_HIDE_WIN32API */ #ifndef __GTHREAD_WIN32_INLINE -#define __GTHREAD_WIN32_INLINE static inline +#define __GTHREAD_WIN32_INLINE __GTHREAD_INLINE #endif #ifndef __GTHREAD_WIN32_COND_INLINE -#define __GTHREAD_WIN32_COND_INLINE static inline +#define __GTHREAD_WIN32_COND_INLINE __GTHREAD_INLINE #endif #ifndef __GTHREAD_WIN32_ACTIVE_P @@ -828,25 +839,25 @@ __gthread_cond_timedwait (__gthread_cond_t *__cond, #endif /* __GTHREAD_HIDE_WIN32API */ -static inline void +__GTHREAD_INLINE void __gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex) { __gthread_mutex_init_function (__mutex); } -static inline void +__GTHREAD_INLINE void __gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex) { __gthread_mutex_destroy (__mutex); } -static inline int +__GTHREAD_INLINE int __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex) { return __gthread_mutex_lock (__mutex); } -static inline int +__GTHREAD_INLINE int __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex) { return __gthread_mutex_unlock (__mutex); @@ -854,13 +865,13 @@ __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex) #if __GTHREAD_HAS_COND -static inline int +__GTHREAD_INLINE int __gthread_cond_destroy (__gthread_cond_t *__cond ATTRIBUTE_UNUSED) { return 0; } -static inline int +__GTHREAD_INLINE int __gthread_cond_wait_recursive (__gthread_cond_t *__cond, __gthread_recursive_mutex_t *__mutex) { diff --git a/libgcc/config/nvptx/alloca.c b/libgcc/config/nvptx/alloca.c new file mode 100644 index 0000000..09bdeb6 --- /dev/null +++ b/libgcc/config/nvptx/alloca.c @@ -0,0 +1,38 @@ +/* Fake 'alloca' implementation. + + Copyright (C) 2025 Free Software Foundation, Inc. + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, or (at your option) any + later version. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + +/* For '-mfake-ptx-alloca', in case real PTX 'alloca' is not available. + With this function defined, we don't get a link-time failure + (unresolved symbol '__GCC_nvptx__PTX_alloca_not_supported'), but rather: + successful execution, in case that 'alloca' is not attempted (if only used + in error code paths, for example), and a run-time failure only in case that + 'alloca' is actually attempted. */ + +void * +__GCC_nvptx__PTX_alloca_not_supported (__SIZE_TYPE__ size __attribute__ ((unused))) +{ + __builtin_printf ("GCC/nvptx: sorry, unimplemented:" + " dynamic stack allocation not supported\n"); + __builtin_abort (); + return 0; +} diff --git a/libgcc/config/nvptx/t-nvptx b/libgcc/config/nvptx/t-nvptx index f295898..5e2e278 100644 --- a/libgcc/config/nvptx/t-nvptx +++ b/libgcc/config/nvptx/t-nvptx @@ -1,7 +1,8 @@ LIB2ADD=$(srcdir)/config/nvptx/reduction.c \ $(srcdir)/config/nvptx/mgomp.c \ $(srcdir)/config/nvptx/atomic.c \ - $(srcdir)/config/nvptx/unwind-nvptx.c + $(srcdir)/config/nvptx/unwind-nvptx.c \ + $(srcdir)/config/nvptx/alloca.c LIB2ADDEH= LIB2FUNCS_EXCLUDE= diff --git a/libgcc/config/nvptx/unwind-nvptx.c b/libgcc/config/nvptx/unwind-nvptx.c index 44657ae..97e22c0 100644 --- a/libgcc/config/nvptx/unwind-nvptx.c +++ b/libgcc/config/nvptx/unwind-nvptx.c @@ -25,6 +25,33 @@ #include "unwind.h" _Unwind_Reason_Code +_Unwind_RaiseException(struct _Unwind_Exception *exc __attribute__ ((__unused__))) +{ + __builtin_abort (); + return 0; +} + +void +_Unwind_DeleteException (struct _Unwind_Exception *exc) +{ + if (exc->exception_cleanup) + (*exc->exception_cleanup) (_URC_FOREIGN_EXCEPTION_CAUGHT, exc); +} + +void +_Unwind_Resume (struct _Unwind_Exception *exc __attribute__ ((__unused__))) +{ + __builtin_abort (); +} + +_Unwind_Reason_Code +_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc __attribute__ ((__unused__))) +{ + __builtin_abort (); + return 0; +} + +_Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument) { return 0; |