From: Jakub Jelinek Date: Wed, 9 Mar 2022 14:25:30 +0000 (+0100) Subject: x86: Define LIBGCC2_UNWIND_ATTRIBUTE on ia32 [PR104781] X-Git-Tag: basepoints/gcc-13~748 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=caa6c33c5d5223c50657b08e73177e8d54ceee51;p=thirdparty%2Fgcc.git x86: Define LIBGCC2_UNWIND_ATTRIBUTE on ia32 [PR104781] On Mon, Mar 07, 2022 at 07:06:28AM -0800, H.J. Lu wrote: > Since eh_return doesn't work with stack realignment, disable SSE on > unwind-c.c and unwind-dw2.c to avoid stack realignment with the 4-byte > incoming stack to avoid SSE usage which is caused by The following change does that using LIBGCC2_UNWIND_ATTRIBUTE macro instead, for ia32 only by forcing -mgeneral-regs-only on routines that call __builtin_eh_return in libgcc. 2022-03-09 Jakub Jelinek PR target/104781 * config/i386/i386.h (LIBGCC2_UNWIND_ATTRIBUTE): Define for ia32. --- diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index b37d4a9966a9..0d28e57f8f2a 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2848,6 +2848,12 @@ extern enum attr_cpu ix86_schedule; #define NUM_X86_64_MS_CLOBBERED_REGS 12 #endif +/* __builtin_eh_return can't handle stack realignment, so restrict to + general regs in 32-bit libgcc functions that call it. */ +#ifndef __x86_64__ +#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((target ("general-regs-only"))) +#endif + /* Local variables: version-control: t