From patchwork Mon Nov 4 20:36:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 288251 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 49ACE2C016B for ; Tue, 5 Nov 2013 07:37:35 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=IT+RVLJOdkUgQmqqgnzVQ6UFBN1FG7RFmIqQ0RFq7ev0yPyjIIaGL FMUutsFJ8aN9nJifok8kPlSuM2JQPG90J66UOLsp0SGUV5wKnUCMwq7Gr8RO4t4m IkeGzNtGGL2mIK0BNDdXFENIvBhp38fxWvnepHiSVjhKraij6Mgb4k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=KoxcIKzjSsU/mubRs/wZgJhnHxs=; b=msLITsaWhB4cXoeoB5dh Rp0+vahTG1S5lB2rbKx+r3YpwUaPI9OJfdeW+ivgpuoaY//V7NKRQ+4KPHsynz9q JjHEJJfEB42UCf8MF3VBoDJdYMsvN6AuYuY32QXLk889dfI+HTUiWHZ5tlZEwFt5 FNM24snd1xTrXd5awejupzI= Received: (qmail 8941 invoked by alias); 4 Nov 2013 20:36:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 8902 invoked by uid 89); 4 Nov 2013 20:36:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RDNS_NONE, SPF_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-wi0-f173.google.com Received: from Unknown (HELO mail-wi0-f173.google.com) (209.85.212.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 04 Nov 2013 20:36:24 +0000 Received: by mail-wi0-f173.google.com with SMTP id ey11so1153564wid.12 for ; Mon, 04 Nov 2013 12:36:14 -0800 (PST) X-Received: by 10.180.185.179 with SMTP id fd19mr13636571wic.18.1383597374886; Mon, 04 Nov 2013 12:36:14 -0800 (PST) Received: from localhost ([2.28.235.51]) by mx.google.com with ESMTPSA id fu1sm7586762wib.8.2013.11.04.12.36.10 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Mon, 04 Nov 2013 12:36:13 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: Remove SHIFT_COUNT_TRUNCATED from double-int.c Date: Mon, 04 Nov 2013 20:36:07 +0000 Message-ID: <878ux3hpl4.fsf@talisman.default> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 ...as suggested by Richard. This means that out-of-range shift values produce the same results on all targets at the tree level. The rtl level isn't affected since it explicitly truncates the count. Tested on mips64-linux-gnu. OK to install? Thanks, Richard gcc/ * double-int.c (lshift_double, rshift_double): Remove SHIFT_COUNT_TRUNCATED handling. Index: gcc/double-int.c =================================================================== --- gcc/double-int.c 2013-09-28 09:41:49.490113799 +0100 +++ gcc/double-int.c 2013-11-04 15:49:56.963164424 +0000 @@ -20,7 +20,7 @@ Free Software Foundation; either version #include "config.h" #include "system.h" #include "coretypes.h" -#include "tm.h" /* For SHIFT_COUNT_TRUNCATED. */ +#include "tm.h" /* For BITS_PER_UNIT and *_BIG_ENDIAN. */ #include "tree.h" static int add_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT, @@ -237,9 +237,6 @@ rshift_double (unsigned HOST_WIDE_INT l1 ? -((unsigned HOST_WIDE_INT) h1 >> (HOST_BITS_PER_WIDE_INT - 1)) : 0); - if (SHIFT_COUNT_TRUNCATED) - count %= prec; - if (count >= HOST_BITS_PER_DOUBLE_INT) { /* Shifting by the host word size is undefined according to the @@ -295,9 +292,6 @@ lshift_double (unsigned HOST_WIDE_INT l1 { unsigned HOST_WIDE_INT signmask; - if (SHIFT_COUNT_TRUNCATED) - count %= prec; - if (count >= HOST_BITS_PER_DOUBLE_INT) { /* Shifting by the host word size is undefined according to the