From patchwork Mon Oct 24 18:24:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 59365 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C39A13857373 for ; Mon, 24 Oct 2022 18:24:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id B7AB73858403 for ; Mon, 24 Oct 2022 18:24:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B7AB73858403 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8549521A85 for ; Mon, 24 Oct 2022 18:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1666635862; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axDiCeHKJ20YtD3579FOedLziic7l+1TCkp5dfGsswY=; b=QnERBRFuBUaeJmtsdV2elCfIvZg2x2tZ2T/JIXBpHRenHADIurDrmmWDJsC8p2VSJ7U+NK PWcF51Ehyc9fYInEw2uhB6sYX69m/s0bGEQF+X+BOPaDf5EVIacioFlBLg91urzcAqEg3/ /mifOtMNRiUP8mTklCpXh2iRYsI18mE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1666635862; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axDiCeHKJ20YtD3579FOedLziic7l+1TCkp5dfGsswY=; b=kN03+XWARCtMFpBdpjOlr+w6dPdRS4GG2ltHkiF7JfeYrLwh1CeO7Axo3o4UOoGHSBjUsy IFuuqtpjcZCEzrDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 780E213357 for ; Mon, 24 Oct 2022 18:24:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UjViHFbYVmNxHQAAMHmgww (envelope-from ) for ; Mon, 24 Oct 2022 18:24:22 +0000 Message-ID: Date: Mon, 24 Oct 2022 20:24:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH (pushed)] x86: fix VENDOR_MAX enum value To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi. The following patch fixes detection of VENDOR_CENTAUR CPU vendors when -march=native is used. Problem what that BUILTIN_VENDOR_MAX dropped the current enum value to VENDOR_OTHER (4) and thus VENDOR_MAX was 5 and not 7. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. I'm going to push it as obvious. PR target/107364 gcc/ChangeLog: * common/config/i386/i386-cpuinfo.h (enum processor_vendor): Reorder enum values as BUILTIN_VENDOR_MAX should not point in the middle of the valid enum values. Martin --- gcc/common/config/i386/i386-cpuinfo.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/common/config/i386/i386-cpuinfo.h b/gcc/common/config/i386/i386-cpuinfo.h index 9893fc422bc..586a1a2d0f6 100644 --- a/gcc/common/config/i386/i386-cpuinfo.h +++ b/gcc/common/config/i386/i386-cpuinfo.h @@ -34,8 +34,10 @@ enum processor_vendor VENDOR_CENTAUR, VENDOR_CYRIX, VENDOR_NSC, + + /* Maximum values must be at the end of this enum. */ + VENDOR_MAX, BUILTIN_VENDOR_MAX = VENDOR_OTHER, - VENDOR_MAX }; /* Any new types or subtypes have to be inserted at the end. */