From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id A374A3857C73 for ; Wed, 9 Mar 2022 11:30:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A374A3857C73 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id A966F1F380; Wed, 9 Mar 2022 11:30:51 +0000 (UTC) Received: from murzim.suse.de (murzim.suse.de [10.160.4.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id B822AA3B85; Wed, 9 Mar 2022 11:30:46 +0000 (UTC) Date: Wed, 9 Mar 2022 12:30:51 +0100 (CET) From: Richard Biener To: Jakub Jelinek cc: "H.J. Lu" , Uros Bizjak , Jeff Law , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] x86, v2: Define LIBGCC2_UNWIND_ATTRIBUTE on ia32 [PR104781] In-Reply-To: Message-ID: <3163o35-s98p-r276-p332-8qp566120qq@fhfr.qr> References: <20220307150628.68146-1-hjl.tools@gmail.com> <6ropo03n-18ns-p21-p717-oo9r6nss789p@fhfr.qr> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2022 11:30:53 -0000 On Wed, 9 Mar 2022, Jakub Jelinek wrote: > On Wed, Mar 09, 2022 at 08:18:38AM +0100, Richard Biener wrote: > > I wonder if this is a good case for general-regs-only instead? At > > least no-sse cannot be functionally equivalent (since then we would > > not have needed general-regs-only ...). > > I think general-regs-only is approx. equivalent to no-mmx,no-sse, > we don't really need/want mmx in the unwinder I guess. > > The following seems to work fine too, regtested with > -O2 -msse2 -mfpmath=sse -mstackrealign in {C,CXX,XC,TC}FLAGS on i686-linux > (where without the patch it fails to build). LGTM. > 2022-03-09 Jakub Jelinek > > PR target/104781 > * config/i386/i386.h (LIBGCC2_UNWIND_ATTRIBUTE): Define for ia32. > > --- gcc/config/i386/i386.h.jj 2022-02-25 21:59:29.356291326 +0100 > +++ gcc/config/i386/i386.h 2022-03-09 10:00:38.242376504 +0100 > @@ -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 > > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Ivo Totev; HRB 36809 (AG Nuernberg)