From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id AE7EB3858D3C for ; Tue, 26 Oct 2021 07:50:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AE7EB3858D3C Received: by mail-ed1-x52f.google.com with SMTP id z20so10372456edc.13 for ; Tue, 26 Oct 2021 00:50:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kqNZIFDDOl0YKqc0iGJanNNLBAS91UpuVkUfrM210kc=; b=JKyWi6yMiYQxVKgg6Uio5wydsLNIvIBzSByFSoG4D/xweO8IfVFJBDRMIJYjzNlWLL vNwfu0pR+c88FFD8wJ4S5ngfuEh/RmVfXPldCtR78+OmrklBtYDXuUVKuXbhxe5YKDFa ty5s+XL/l0QSF0WP79WN4Buu6122qieU5iDXFi5m4Os2eBnCUFewszY0ZAkLZWiwI2Lk KpP7Fqu4AiAKbXq3T8GSFnQ2qrl0auUNv1g7HRLnniqlrz1boruE7AClB0F1BWZjndGZ u+Jg0uAsQT8y+6Aw5hCjjJpwF2XTZeEzmtGhDANW1XSoqblvoYBdvz7uaf1JghOTAYY6 gywQ== X-Gm-Message-State: AOAM531b2f1E2lI7d2lqXlS941uohapufdjzOB05qp9vLhGyr1aBdHci 1GDysSCGwW5EvV5uyzG1G4B1bb7NaLrlSFSUxFQ1MadS X-Google-Smtp-Source: ABdhPJyevqLtfb9DCNS0Rt0P+hiLVifeZfYm//ZuspbAb05ox5sNQxxecFRs+HTBl4ZfoLVwjZA3ahG1nBdXmCZzGMw= X-Received: by 2002:a17:906:c301:: with SMTP id s1mr28270662ejz.56.1635234624680; Tue, 26 Oct 2021 00:50:24 -0700 (PDT) MIME-Version: 1.0 References: <96541e9b-46ff-e4a1-e60c-1d035f219560@linux.ibm.com> In-Reply-To: <96541e9b-46ff-e4a1-e60c-1d035f219560@linux.ibm.com> From: Richard Biener Date: Tue, 26 Oct 2021 09:50:13 +0200 Message-ID: Subject: Re: [PATCH] forwprop: Remove incorrect assertion [PR102897] To: "Kewen.Lin" Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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, 26 Oct 2021 07:50:27 -0000 On Tue, Oct 26, 2021 at 5:40 AM Kewen.Lin wrote: > > Hi, > > As PR102897 shows, there is one incorrect assertion in function > simplify_permutation, which is based on the wrong assumption that > all cases with op2_type == tgt_type are handled previously, the > proposed fix is to remove this wrong assertion. > > Bootstrapped and regtested on x86_64-redhat-linux, > aarch64-linux-gnu and powerpc64{,le}-linux-gnu. I think you need to enable optimization in the new testcase, gcc.dg/ only runs -O0 by default which wouldn't trigger forwprop? Please verify the testcase ICEs before the fix. Otherwise OK. Thanks, Richard, > BR, > Kewen > ----- > gcc/ChangeLog: > > PR tree-optimization/102897 > * tree-ssa-forwprop.c (simplify_permutation): Remove a wrong assertion. > > gcc/testsuite/ChangeLog: > > * gcc.dg/pr102897.c: New test. > --- > gcc/testsuite/gcc.dg/pr102897.c | 16 ++++++++++++++++ > gcc/tree-ssa-forwprop.c | 2 -- > 2 files changed, 16 insertions(+), 2 deletions(-) > create mode 100644 gcc/testsuite/gcc.dg/pr102897.c > > diff --git a/gcc/testsuite/gcc.dg/pr102897.c b/gcc/testsuite/gcc.dg/pr102897.c > new file mode 100644 > index 00000000000..d96b0e48ccc > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/pr102897.c > @@ -0,0 +1,16 @@ > +/* { dg-do compile } */ > +/* Specify C99 to avoid the warning/error on compound literals. */ > +/* { dg-options "-std=c99" } */ > + > +/* Verify that there is no ICE. */ > + > +typedef __attribute__((vector_size(8))) signed char int8x8_t; > +typedef __attribute__((vector_size(8))) unsigned char uint8x8_t; > + > +int8x8_t fn1 (int8x8_t val20, char tmp) > +{ > + uint8x8_t __trans_tmp_3; > + __trans_tmp_3 = (uint8x8_t){tmp}; > + int8x8_t __a = (int8x8_t) __trans_tmp_3; > + return __builtin_shuffle (__a, val20, (uint8x8_t){0}); > +} > diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c > index 5b30d4c1a76..a830bab78ba 100644 > --- a/gcc/tree-ssa-forwprop.c > +++ b/gcc/tree-ssa-forwprop.c > @@ -2267,8 +2267,6 @@ simplify_permutation (gimple_stmt_iterator *gsi) > if (!VECTOR_TYPE_P (tgt_type)) > return 0; > tree op2_type = TREE_TYPE (op2); > - /* Should have folded this before. */ > - gcc_assert (op2_type != tgt_type); > > /* Figure out the shrunk factor. */ > poly_uint64 tgt_units = TYPE_VECTOR_SUBPARTS (tgt_type); > -- > 2.27.0