From patchwork Tue Oct 24 10:04:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 157361 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1833574vqx; Tue, 24 Oct 2023 03:04:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELRt3UOL/wjW/QgIE+7mIqIrcuRbStEunTLFWHLp8J/Tr7taNPUUudYVXbCH+PLWLAwrft X-Received: by 2002:ae9:e517:0:b0:777:7178:ebf2 with SMTP id w23-20020ae9e517000000b007777178ebf2mr10140544qkf.18.1698141889256; Tue, 24 Oct 2023 03:04:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698141889; cv=pass; d=google.com; s=arc-20160816; b=0cP0v1d1qJvKkmctv4eeBIbkWH7d9eEwvqTq5ieycZKwm7AZ3VQ2jHsUDj9cMJd3vr s9VROkSI//HnoPKe5fm/C1w7tc3JHWi1B7mLJRyyiOaSVU9hVuVhM3cjZL1jM1Z2uy5u Hm2hyVBsbhrla6QQC7GNGQP164FND7kBnBnE2df4xDJH7bE9QMkSZt3L6wNLEOAYh8YZ 7qEDKfneAqp7FwKaRR6/nV6C1wT2lMQRga7eDDSE7D/XnXNwcgE8LTSq2N2hP2DCT+8F iTan7b/W2/lppTPDaBt/fj5yizVGD9oMhyORi9OsITgQlztmOBIVZRVRW6Bb2aa+7VNz NCSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:date:subject:mail-followup-to:to:from:arc-filter :dmarc-filter:delivered-to; bh=3rJIuQXkNZjRBA2Kp4V9tWCIui8qY/9LHZVscM4oWDg=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=ClR+qB1c858KucZ7i3wZKXKsmSqSYmeyDPMsn+m0T4MkFgq7XqnhoK+ehL+lQ1MyYt pXnDsYCajGhyjC8UhJqXzXs/PnW8t3XjhshFK/CJC7fXwPxssClwnVVPMU9NQt20hI2X oGDC8Pp77cA7t8c1IJzEL6cJyQsbQ4DCDsUjRydh75PC/QmSui2umOXFj/Lhxbjp+jpo vYS5qFWzB9toka2b4TR0eWoz+/OmS8DyJQVmuFXmYRsGqdfc50cwAy++5zMFtYFB9lST wOnEOw+Y1Vn3WG3o5DuQmLj7+zYCv85ogcdfuNnCFz4viYsnVl6URJxA/d5IB9kWKu7a 7Qhg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id y7-20020a05620a25c700b00775a534c005si6855634qko.129.2023.10.24.03.04.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 03:04:49 -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; arc=pass (i=1); 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0D9D1385782B for ; Tue, 24 Oct 2023 10:04:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 892523858C01 for ; Tue, 24 Oct 2023 10:04:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 892523858C01 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 892523858C01 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698141867; cv=none; b=YTS8urThgeK9vbosJT35JqpN4cv3kpH0V/NK39DSzQPlDBCAC9Q8W1FA7pPmj6m5s1JMhTWiDArW5mt57a4jLOKXN+4Je9wokDxNKsc3+6LvnMm/FVlGHj9rMiNQ5Eq5DvfsCP/3a0TrKmSXl7qia+wN+HAnKqfaIv9P2fC2uxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698141867; c=relaxed/simple; bh=pLDEYP5US9UFIoexzDli3vLb9eT4W4Tu5R+XLNyfiao=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ZFd2i54t+5dZdTXjrZ2glPrp+QNkzcj8C+FLHoW33K5accSQ8JgvASS7yzRxxTto2CKb8G6CDhAtSRx8Axou5v/DKF4fAk25BzRqBDOAgh0IUhdUhhW5MJCt/Xu1jwms5Ds8saDrjJwpU1DwROTJH4TZjUslW9FqqpSyep8FhUc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ED7511FB for ; Tue, 24 Oct 2023 03:05:06 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 98EA03F64C for ; Tue, 24 Oct 2023 03:04:25 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [pushed] i386: Fix unprotected REGNO in aeswidekl_operation Date: Tue, 24 Oct 2023 11:04:24 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-23.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, 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.30 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780630829722462303 X-GMAIL-MSGID: 1780630829722462303 I hit an ICE in aeswidekl_operation while testing the late-combine pass on x86. The predicate tested REGNO without first testing REG_P. Tested on x86_64-linux-gnu & pushed as obvious. Richard gcc/ * config/i386/predicates.md (aeswidekl_operation): Protect REGNO check with REG_P. --- gcc/config/i386/predicates.md | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index ef49efdbde5..e3d55f0c502 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -2260,6 +2260,7 @@ (define_predicate "aeswidekl_operation" || GET_CODE (SET_SRC (elt)) != UNSPEC_VOLATILE || GET_MODE (SET_SRC (elt)) != V2DImode || XVECLEN (SET_SRC (elt), 0) != 1 + || !REG_P (XVECEXP (SET_SRC (elt), 0, 0)) || REGNO (XVECEXP (SET_SRC (elt), 0, 0)) != GET_SSE_REGNO (i)) return false; }