From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by sourceware.org (Postfix) with ESMTPS id 2F0F03858401 for ; Sat, 11 Sep 2021 00:29:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F0F03858401 Received: by mail-vs1-xe36.google.com with SMTP id a25so3133733vso.5 for ; Fri, 10 Sep 2021 17:29:37 -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=meid9ORJB2Ij7MnroQuNcUGMiuyXZ4BoY4xSNcrsOpo=; b=hkmhTroa+fNW0tyR1rDUs5F+GQ4wO37yA83CEAqYCYl8DPwqrxSLJS+B0t0nY1lHc7 QHl95d1Utyx5vi0orrcSaSNhcQgsxiCIh3e/ZcRQ4czNm6P8KkeAPQVetEvTCVeGR3io y1rL712RrkiST4EtZJDDPp6J7HvifjP1B4dzloyW+N5F1hkwGQLM09kVs1KLViC/mdWq 14IcS09plM1SQ8s7YoEsJrmEZMiM2M2l9zWmDIPwNVKTMiTHHq//0hvB3nBEMxlXw+Ix Flt6Ae0AjsEWVMQFNl47sFIeednQjQaZnfqSNy0gocIrBfry7iWHxUh1MHDiSPXu065d L20A== X-Gm-Message-State: AOAM533S8A6dB7SXF3cCT2umeG4x9ca5py6AAiXV9rjXNlCRRDGUpwGt e2Apo1oe0cmwqDdY5GalFSNtnCwjoD2gYfWTD7c= X-Google-Smtp-Source: ABdhPJzU3Y60j4PwhFaHoFEbzjt9miR4v1iQoovudADwc1vdGjOVkr8VWMjWUr4Vjt2VuSWAhA90C3oubtnynycQdpc= X-Received: by 2002:a67:f243:: with SMTP id y3mr97861vsm.33.1631320176782; Fri, 10 Sep 2021 17:29:36 -0700 (PDT) MIME-Version: 1.0 References: <20210910125818.334531-1-hongtao.liu@intel.com> <20210910125818.334531-3-hongtao.liu@intel.com> <20210910211914.GB1583@gate.crashing.org> In-Reply-To: <20210910211914.GB1583@gate.crashing.org> From: Hongtao Liu Date: Sat, 11 Sep 2021 08:29:25 +0800 Message-ID: Subject: Re: [PATCH 2/2] validate_subreg before call gen_lowpart to avoid ICE. To: Segher Boessenkool Cc: Richard Biener , liuhongt , Michael Meissner , Andrew Waterman , asolokha@gmx.com, Andreas Schwab , GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, 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: Sat, 11 Sep 2021 00:29:38 -0000 On Sat, Sep 11, 2021 at 5:21 AM Segher Boessenkool wrote: > > On Fri, Sep 10, 2021 at 10:25:45PM +0800, Hongtao Liu wrote: > > Updated patch. > > > > Bootstrapped and regtested on x86_64-linux-gnu{-m32,}, do I need to > > run this patch on other targets machine, or the patch is supposed to > > have minimal impact on other targets? > > Then, ok for trunk? > > [-- Attachment #2: v2-0001-Check-modes_tieable_p-before-call-gen_lowpart-to-.pat > ch --] > [-- Type: application/octet-stream, Encoding: base64, Size: 1.4K --] > > [-- application/octet-stream is unsupported (use 'v' to view this part) --] > > Please send your patches inline, or if you *have to* use attachments, > use text attachments. Without encoding. > hmm, my local file is $file 0001-Check-modes_tieable_p-before-call-gen_lowpart-to-avo.patch --mime-type 0001-Check-modes_tieable_p-before-call-gen_lowpart-to-avo.patch: text/x-diff Didn't figure out how to let webgmail not change mime type of attachment. > > > (It says "strongly discouraged", which means people will put it to the > bottom of the stack of things to look at). > > > Segher Here is an updated patch. Bootstrapped and regtested on x86_64-linux-gnu{-m32,} Ok for trunk? gcc/ChangeLog: * machmode.h (TRULY_NOOP_TRUNCATION_MODES_P): Check SCALAR_INT_MODE_P for both modes. --- gcc/machmode.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/machmode.h b/gcc/machmode.h index 158351350de..9f95d7d046c 100644 --- a/gcc/machmode.h +++ b/gcc/machmode.h @@ -959,9 +959,10 @@ extern scalar_int_mode ptr_mode; /* Target-dependent machine mode initialization - in insn-modes.c. */ extern void init_adjust_machine_modes (void); -#define TRULY_NOOP_TRUNCATION_MODES_P(MODE1, MODE2) \ - (targetm.truly_noop_truncation (GET_MODE_PRECISION (MODE1), \ - GET_MODE_PRECISION (MODE2))) +#define TRULY_NOOP_TRUNCATION_MODES_P(MODE1, MODE2) \ + (SCALAR_INT_MODE_P(MODE1) && SCALAR_INT_MODE_P(MODE2) \ + && targetm.truly_noop_truncation (GET_MODE_PRECISION (MODE1), \ + GET_MODE_PRECISION (MODE2))) /* Return true if MODE is a scalar integer mode that fits in a HOST_WIDE_INT. */ -- BR, Hongtao