From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by sourceware.org (Postfix) with ESMTPS id BD56A3858D1E for ; Sun, 4 Jun 2023 07:51:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD56A3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-xf2d.google.com with SMTP id 6a1803df08f44-6262d8688baso38086266d6.1 for ; Sun, 04 Jun 2023 00:51:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685865077; x=1688457077; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Q/VRWsGrXK6rGjRuZmybtfZzsytLCy6VW24v1UOvWI0=; b=h2GFZad5BSb1mnh9LzBKzHQSjO+uDIm5pjyZWyZt5C9QwCBP6I3FAvUmy215YwIw1u D+tdxqKof3QtYFr6tm1V7+dHUpj9FYV9gUDinETBG+ZfS9f3o22Us08WxgOIzlT7Qzs2 bPtT7arWcIZG7STD7jiI9ZY3YE4R1FTiULyScKVEvY3qtTo2S4nByZIzFptwVi/O3TM/ snCPyRMgUok7EiC1RMU/fXGMwzQOmw9hK7vlRnziu1R0CMoV7boUxzu/ExbykyI+YHOa R0HD/Gdr4gnCjw9xfK3ovQwEcc0Zx1TnlQFvnOp0BM3X8BRaDtuJHWCPc01RmjyVEHwi o1Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685865077; x=1688457077; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q/VRWsGrXK6rGjRuZmybtfZzsytLCy6VW24v1UOvWI0=; b=JPaEjE/ZaBIIPxbuaZet10SG8nU6rLxOj6loX5XZQxnAD7fruf0bX5u0tvg4ei/xWD gTTFZ3GtqduJSCoVQjej0+huDDRUHjeYVmwJYJaQDi3+DMNlXjvoim31/P2M1QPT6vM7 ceJc0E11qWAxpM1xHd5+oF+oPdQM0+IBIWmuX9M5XZNE4blGz3P3vhCBd+JD9SQ63EgZ q46jWdq5s/vagt+BhzdEhlayd9QzSoxhe/keOQGgWVGzygcskK16WdVV5EAnFZp2N025 wIYcKah5ySbGZHUMGqhto4IFVM0Dn2wwSqO7G6OFihZtFmnmnzw1kvSq9MjP8teVDYSr FDcQ== X-Gm-Message-State: AC+VfDy3ZIpjm9jcr9SGpxme1AxiGL/94viFyyZe5UH9wuPduRU7Q+KZ jbfxOAQjozH65+fpyW3GwPYIy1UxhYcZvnfoRO6mw5FBi60= X-Google-Smtp-Source: ACHHUZ6o87j8uqoVmh2R58EDJCt2rfkun03CdOM8ypeiuZAO/JipiynME19Wuk5xMdYGgrKGt5ufJSq995ce1AOplM8= X-Received: by 2002:a05:6214:e63:b0:628:335a:174d with SMTP id jz3-20020a0562140e6300b00628335a174dmr4911219qvb.36.1685865076641; Sun, 04 Jun 2023 00:51:16 -0700 (PDT) MIME-Version: 1.0 References: <035801d99641$43215980$c9640c80$@nextmovesoftware.com> In-Reply-To: <035801d99641$43215980$c9640c80$@nextmovesoftware.com> From: Uros Bizjak Date: Sun, 4 Jun 2023 09:51:13 +0200 Message-ID: Subject: Re: [x86_64 PATCH] PR target/110083: Fix-up REG_EQUAL notes on COMPARE in STV. To: Roger Sayle Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, Jun 3, 2023 at 7:31=E2=80=AFPM Roger Sayle wrote: > > > This patch fixes PR target/110083, an ICE-on-valid regression exposed by > my recent PTEST improvements (to address PR target/109973). The latent > bug (admittedly mine) is that the scalar-to-vector (STV) pass doesn't upd= ate > or delete REG_EQUAL notes attached to COMPARE instructions. As a result > the operands of COMPARE would be mismatched, with the register transforme= d > to V1TImode, but the immediate operand left as const_wide_int, which is > valid for TImode but not V1TImode. This remained latent when the STV > conversion converted the mode of the COMPARE to CCmode, with later passes > recognizing the REG_EQUAL note is obviously invalid as the modes didn't > match, but now that we (correctly) preserve the CCZmode on COMPARE, the > mismatched operand modes trigger a sanity checking ICE downstream. > > Fixed by updating (or deleting) any REG_EQUAL notes in convert_compare. > > Before: > (expr_list:REG_EQUAL (compare:CCZ (reg:V1TI 119 [ ivin.29_38 ]) > (const_wide_int 0x80000000000000000000000000000000)) > > After: > (expr_list:REG_EQUAL (compare:CCZ (reg:V1TI 119 [ ivin.29_38 ]) > (const_vector:V1TI [ > (const_wide_int 0x80000000000000000000000000000000) > ])) > > This patch has been tested on x86_64-pc-linux-gnu with make bootstrap > and make -k check, both with and without --target_board=3Dunix{-m32} > with no new failures. Ok for mainline? > > > 2023-06-03 Roger Sayle > > gcc/ChangeLog > PR target/110083 > * config/i386/i386-features.cc (scalar_chain::convert_compare): > Update or delete REG_EQUAL notes, converting CONST_INT and > CONST_WIDE_INT immediate operands to a suitable CONST_VECTOR. > > gcc/testsuite/ChangeLog > PR target/110083 > * gcc.target/i386/pr110083.c: New test case. OK. Thanks, Uros. > > > Roger > -- >