From patchwork Mon Nov 30 01:28:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 1407926 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=SP/1+47b; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cknh115DZz9sTv for ; Mon, 30 Nov 2020 12:29:05 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9E38D38708AD; Mon, 30 Nov 2020 01:29:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E38D38708AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1606699742; bh=7VmeKh6ULSdsU6RlkRDg/FVfyDZ86ZbRQuortLUt7IY=; h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=SP/1+47bHsnlgxKkRw+qsSNiAv2lXP4HSVE+147TE8P+2QonNLqS31sS0a0rLZq4n udm2w6Sk6ryhSGToXZqUAVnqc4imZip5Rq18+QfwI903Ovf5/EK05aDHs7Exb5WtNh 1iKl8YxU851mfym77Hi7CMfAO1jsu+C85ogz/iRU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 873763857C6F for ; Mon, 30 Nov 2020 01:29:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 873763857C6F Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-9-MwI49F_lMlidd4EaAnmHFg-1; Sun, 29 Nov 2020 20:28:57 -0500 X-MC-Unique: MwI49F_lMlidd4EaAnmHFg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A2D55802B49 for ; Mon, 30 Nov 2020 01:28:56 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-145.phx2.redhat.com [10.3.112.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 850335C1BB for ; Mon, 30 Nov 2020 01:28:56 +0000 (UTC) Subject: [committed] Fix minor bug in ft32 widening multiply To: GCC Patches Message-ID: Date: Sun, 29 Nov 2020 18:28:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-Patchwork-Original-From: Jeff Law via Gcc-patches From: Jeff Law Reply-To: Jeff Law Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Combine has this little check:      /* Replacing the operand of a SUBREG or a ZERO_EXTEND with a          CONST_INT is not valid, because after the replacement, the          original mode would be gone.  Unfortunately, we can't tell          when do_SUBST is called to replace the operand thereof, so we          perform this test on oldval instead, checking whether an          invalid replacement took place before we got here.  */       gcc_assert (!(GET_CODE (oldval) == SUBREG                     && CONST_INT_P (SUBREG_REG (oldval))));       gcc_assert (!(GET_CODE (oldval) == ZERO_EXTEND                     && CONST_INT_P (XEXP (oldval, 0)))); Which indirectly implies that we can never have these in the IL prior to combine.  The ft32 port has recently started regressing a few tests because it's triggering those assertions.  This isn't a huge surprise as the port allows (zero_extend (const_int)) for a subset of const_int values. This patch tightens the predicate & constraints which fixes the recent regression.  In fact, it fixes a few dozen long standing failures in the testsuite on ft32-elf and since the compiler is no longer faulting as much, there's more execution tests being run as well. Committed to the trunk. JEff commit a8ae23920f9c954ed66bd92ddbdbb1b8486b950f Author: Stefan Kanthak Date: Sun Nov 29 18:05:46 2020 -0700 fixed _bswapsi2 function libgcc * libgcc2.c (bswapsi2): Make constants unsigned. diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c index 1921d80f612..61de3b42e1d 100644 --- a/libgcc/libgcc2.c +++ b/libgcc/libgcc2.c @@ -468,10 +468,10 @@ __ashrdi3 (DWtype u, shift_count_type b) SItype __bswapsi2 (SItype u) { - return ((((u) & 0xff000000) >> 24) - | (((u) & 0x00ff0000) >> 8) - | (((u) & 0x0000ff00) << 8) - | (((u) & 0x000000ff) << 24)); + return ((((u) & 0xff000000u) >> 24) + | (((u) & 0x00ff0000u) >> 8) + | (((u) & 0x0000ff00u) << 8) + | (((u) & 0x000000ffu) << 24)); } #endif #ifdef L_bswapdi2