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 9AD3B3857835 for ; Tue, 15 Mar 2022 09:18:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9AD3B3857835 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-650-ZsSKQourOfS1-0_N9wCJzA-1; Tue, 15 Mar 2022 05:18:46 -0400 X-MC-Unique: ZsSKQourOfS1-0_N9wCJzA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CEF11811E84; Tue, 15 Mar 2022 09:18:45 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90962C53741; Tue, 15 Mar 2022 09:18:45 +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 22F9IgDV2152117 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 15 Mar 2022 10:18:43 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 22F9IfCF2152116; Tue, 15 Mar 2022 10:18:41 +0100 Date: Tue, 15 Mar 2022 10:18:41 +0100 From: Jakub Jelinek To: Richard Biener , Uros Bizjak Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] i386: Use no-mmx,no-sse for LIBGCC2_UNWIND_ATTRIBUTE [PR104890] Message-ID: Reply-To: Jakub Jelinek MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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=-4.1 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, 15 Mar 2022 09:18:51 -0000 Hi! Regardless of the outcome of the general-regs-only stuff in x86gprintrin.h, apparently general-regs-only is much bigger hammer than no-sse, and e.g. using 387 instructions in the unwinder isn't a big deal, it never needs to realign the stack because of it. So, the following patch uses no-sse (and adds no-mmx to it, even when not strictly needed). Bootstrapped/regtested on x86_64-linux and i686-linux, on the latter both normally and with -msse2 -mfpmath=sse -mstackrealign in the options and --enable-cet, ok for trunk? 2022-03-15 Jakub Jelinek PR target/104890 * config/i386/i386.h (LIBGCC2_UNWIND_ATTRIBUTE): Use no-mmx,no-sse instead of general-regs-only. --- gcc/config/i386/i386.h.jj 2022-03-09 15:25:28.355498493 +0100 +++ gcc/config/i386/i386.h 2022-03-14 15:27:33.831976579 +0100 @@ -2848,10 +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 restrict to - general regs in 32-bit libgcc functions that call it. */ +/* __builtin_eh_return can't handle stack realignment, so disable MMX/SSE + in 32-bit libgcc functions that call it. */ #ifndef __x86_64__ -#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((target ("general-regs-only"))) +#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((target ("no-mmx,no-sse"))) #endif /* Jakub