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: 9925 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp591849wru; Mon, 24 Oct 2022 11:24:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7KJrscunGG86OrKghaOMSjT43esMy1YLCnPtMi0SGQC43iy8CiJn9YMhZdOg9t2e7lAW80 X-Received: by 2002:a17:907:3d91:b0:78d:f675:5659 with SMTP id he17-20020a1709073d9100b0078df6755659mr28187143ejc.92.1666635892031; Mon, 24 Oct 2022 11:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666635892; cv=none; d=google.com; s=arc-20160816; b=ZAFkj1q036WuS2n82w/cFUr/DuyJfI1swqYnyZ8CCdcM+0yI2C56tBrChmzV0PWrIA BTDKdjFakZwtnJnrB8Py8XbQdPGG6iIgHxKFBYg8TYnNt88cSCvVb9NjmprhAhN6clp+ 1pgdvYVZ17gzxSelAuEoTNiU1simGTk0nvngltxzOrseYV9hp45zrVNqIRBRtnMHm3FE dgThupFMhZ8BaKpUIzMLHvaPnUd87pbH5ZoRq3gtbvMYuIdeAEvvzOrJWt3T+tiu28vI QR7Wvdh2vHrYnIIVWQ3RUdiSgSaG1vo9Aevsm/5cHoTsDoODWzWLpHcQq7XO8WEHgunC GEfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :content-language:to:subject:from:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature:dmarc-filter:delivered-to; bh=axDiCeHKJ20YtD3579FOedLziic7l+1TCkp5dfGsswY=; b=vTfUuZREzN8qjvLKP481kmun7d4cdirQqwplZ3+iOjeG2xHMytLM9qJqOzC0xpYCHw wKISwJihOdjsC5OXMoVbbsmEIqKIDQ4urQf3786FWZk4HdF6/WOJUzzqDRJXRTiaM4gx c8eVet/s3m1LmYMjhkG6lnGrQLQ3zqYFc6UPQpZk8pW2wSb5ii/9ca60pPAr8SGYF5dE 8moEMm7vqKcIAkKpGBlZ0kTuybWK+c3Yjp6hoNJ1ns3DVsLAPCS5VSNax6scpZaBBCmV jP6XbY9MZlQrnWpdzGeevwNc2aBSYRxvTCqN0MRwIWJ07IEmWyFb5SX2XkHa+bC84FsB V7Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=QnERBRFu; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id y12-20020a056402270c00b00461a5271515si463594edd.618.2022.10.24.11.24.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 11:24:52 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=QnERBRFu; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0330E3856DC0 for ; Mon, 24 Oct 2022 18:24:48 +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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747594396892169504?= X-GMAIL-MSGID: =?utf-8?q?1747594396892169504?= 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. */