From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0852A3858C83 for ; Tue, 8 Mar 2022 12:29:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0852A3858C83 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-338-Dllv_mj6MiOBW630rqwZWg-1; Tue, 08 Mar 2022 07:29:53 -0500 X-MC-Unique: Dllv_mj6MiOBW630rqwZWg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 995C2801DDB; Tue, 8 Mar 2022 12:29:52 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 139857B61D; Tue, 8 Mar 2022 12:29:51 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 228CTmx73781146 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 8 Mar 2022 13:29:48 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 228CTlMr3781145; Tue, 8 Mar 2022 13:29:47 +0100 Date: Tue, 8 Mar 2022 13:29:46 +0100 From: Jakub Jelinek To: "H.J. Lu" , Eric Botcazou , gcc-patches@gcc.gnu.org Subject: Re: [PATCH v3] x86: Disable SSE on unwind-c.c and unwind-dw2.c Message-ID: Reply-To: Jakub Jelinek References: <20220307150628.68146-1-hjl.tools@gmail.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: Tue, 08 Mar 2022 12:29:58 -0000 On Tue, Mar 08, 2022 at 12:15:15PM +0100, Jakub Jelinek via Gcc-patches wrote: > > --- gcc/config/i386/i386.h.jj 2022-02-25 12:06:45.535493490 +0100 > > +++ gcc/config/i386/i386.h 2022-03-08 11:20:43.207043370 +0100 > > @@ -2848,6 +2848,10 @@ extern enum attr_cpu ix86_schedule; > > #define NUM_X86_64_MS_CLOBBERED_REGS 12 > > #endif > > > > +/* __builtin_eh_return can't handle stack realignment, so disable SSE in > > + libgcc functions that call it. */ > > +#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((target ("no-sse"))) > > + > > /* > > Local variables: > > version-control: t > > > > > > As mentioned in PR104838, this likely isn't specific to just Solaris and > > cygwin/mingw. Fedora uses -msse2 -mfpmath=sse -mstackrealign in its C{,XX}FLAGS > > among other things for i686. > > Now verified that with your full patch applied gcc on Fedora/i686 doesn't > build (gets those sorry messages when compiling unwind-dw2), while if I > replace those 2 libgcc hunks from your patch with the above one it seems to > get past the previous hanging point of gnat1 processes. Though, perhaps it should be #ifndef __x86_64__ #define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((target ("no-sse"))) #endif or something similar, on x86-64 one at least normally doesn't use lower stack realignment unless avx or later. Maybe we want to use no-avx for the x86-64 case though. Disabling sse/sse2 might be a problem especially on mingw where we need to restore SSE registers in the EH return, no? Even better would be to make __builtin_eh_return work even with DRAP, but I admit I haven't understood what exactly is the problem that prevents it from working. Jakub