From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61535 invoked by alias); 8 Jul 2019 07:11:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 61245 invoked by uid 89); 8 Jul 2019 07:11:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=H*Ad:U*john, H*F:U*john, H*r:Debian-8, HX-HELO:sk:fencepo X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (209.51.188.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 Jul 2019 07:11:39 +0000 Received: from eggs.gnu.org ([2001:470:142:3::10]:41236) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hkNoH-0003eo-A0 for gcc-patches@gnu.org; Mon, 08 Jul 2019 03:11:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkNoG-0000D7-8i for gcc-patches@gnu.org; Mon, 08 Jul 2019 03:11:37 -0400 Received: from de.cellform.com ([88.217.224.109]:46178 helo=jocasta.intra) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hkNoF-00009r-TB for gcc-patches@gnu.org; Mon, 08 Jul 2019 03:11:36 -0400 Received: from jocasta.intra (localhost [127.0.0.1]) by jocasta.intra (8.15.2/8.15.2/Debian-8) with ESMTPS id x687BRjF000829 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 8 Jul 2019 09:11:27 +0200 Received: (from john@localhost) by jocasta.intra (8.15.2/8.15.2/Submit) id x687BRCZ000827; Mon, 8 Jul 2019 09:11:27 +0200 From: John Darrington To: gcc-patches@gnu.org Cc: John Darrington Subject: [PATCH] simplify-rtx.c (simplify_unary_operation_1): Change BITSIZE to PRECISION. Date: Mon, 08 Jul 2019 07:26:00 -0000 Message-Id: <20190708071108.773-2-john@darrington.wattle.id.au> In-Reply-To: <20190708071108.773-1-john@darrington.wattle.id.au> References: <20190708071108.773-1-john@darrington.wattle.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 88.217.224.109 X-SW-Source: 2019-07/txt/msg00524.txt.bz2 gcc/ * simplify-rtx.c (simplify_unary_operation_1): Change BITSIZE to PRECISION in simplification of (extend ashiftrt (ashift ..))) Otherwise the gcc_assert can catch when dealing with partial int modes. --- gcc/ChangeLog | 6 ++++++ gcc/simplify-rtx.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d3d359..919b9e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-07-04 John Darrington + + simplify-rtx.c: Change BITSIZE to UNIT_PRECISION in simplification of + (extend ashiftrt (ashift ..))) Otherwise the gcc_assert will catch + when dealing with partial int modes. + 2019-07-04 Jakub Jelinek * omp-low.c (lower_omp_scan): Call lower_omp on stmt's body diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 89a46a9..d1cd428 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -1504,12 +1504,12 @@ simplify_unary_operation_1 (enum rtx_code code, machine_mode mode, rtx op) && CONST_INT_P (XEXP (op, 1)) && XEXP (XEXP (op, 0), 1) == XEXP (op, 1) && (op_mode = as_a (GET_MODE (op)), - GET_MODE_BITSIZE (op_mode) > INTVAL (XEXP (op, 1)))) + GET_MODE_PRECISION (op_mode) > INTVAL (XEXP (op, 1)))) { scalar_int_mode tmode; - gcc_assert (GET_MODE_BITSIZE (int_mode) - > GET_MODE_BITSIZE (op_mode)); - if (int_mode_for_size (GET_MODE_BITSIZE (op_mode) + gcc_assert (GET_MODE_PRECISION (int_mode) + > GET_MODE_PRECISION (op_mode)); + if (int_mode_for_size (GET_MODE_PRECISION (op_mode) - INTVAL (XEXP (op, 1)), 1).exists (&tmode)) { rtx inner = -- 1.8.3.1