From patchwork Sat Nov 2 10:19:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 287965 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 E83352C0095 for ; Sat, 2 Nov 2013 21:19:47 +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:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=UTY4abYjJgCZ9M+x04ArtLmOqFpyi4+Ex4qxWe4suvc6D3VP7+ uYzefkIFvc90BqVqkntwRPuXSUj2TJAK4GQDvCHroJyva6fqKXG2JEQkS37gDwgc KFNbnSAbfvp8Uj3x8ROFkfKX3IFqXbE1jfmBX95Xo1gjUQI8Hi9gOFVnk= 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:cc:subject:date:message-id:mime-version:content-type; s= default; bh=NQPjT8fATqIaEyxIULqlscalyH0=; b=x+YgmpX91skodyYjUPX+ 3MwgCo1nyUiYsLsxQwKniOLM8RWtXeCjE+fz5k6/T7saGG+pkaaOUVk2dEgOv0Qp zX3s3AheXvMvnoxVOv52o6oQcBn/ODbN6t2npLJal2e6SoPbE9CJDbZcqyblfEDx gbHoMwS1onw8nKm4q3VlZk4= Received: (qmail 29271 invoked by alias); 2 Nov 2013 10:19:41 -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 29262 invoked by uid 89); 2 Nov 2013 10:19:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f176.google.com Received: from mail-we0-f176.google.com (HELO mail-we0-f176.google.com) (74.125.82.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 02 Nov 2013 10:19:39 +0000 Received: by mail-we0-f176.google.com with SMTP id w62so428965wes.7 for ; Sat, 02 Nov 2013 03:19:36 -0700 (PDT) X-Received: by 10.180.99.99 with SMTP id ep3mr5285716wib.11.1383387576656; Sat, 02 Nov 2013 03:19:36 -0700 (PDT) Received: from localhost ([2.28.235.51]) by mx.google.com with ESMTPSA id y20sm15833734wib.0.2013.11.02.03.19.36 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Sat, 02 Nov 2013 03:19:36 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, zadeck@naturalbridge.com, mikestump@comcast.net, rdsandiford@googlemail.com Cc: zadeck@naturalbridge.com, mikestump@comcast.net Subject: [wide-int] Fix exact_log2 zext test Date: Sat, 02 Nov 2013 10:19:35 +0000 Message-ID: <87fvrfksw8.fsf@talisman.default> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 ...which I'd fluffed when doing the wi:: conversion. Tested on powerpc64-linux-gnu and x86_64-linux-gnu. It fixed a spurious gcc.dg difference on alpha-linux-gnu. Applied as obvious. Thanks, Richard Index: gcc/wide-int.cc =================================================================== --- gcc/wide-int.cc (revision 204311) +++ gcc/wide-int.cc (working copy) @@ -2044,7 +2044,7 @@ /* Get a zero-extended form of block CRUX. */ unsigned HOST_WIDE_INT hwi = x.val[crux]; - if (crux * HOST_BITS_PER_WIDE_INT > x.precision) + if ((crux + 1) * HOST_BITS_PER_WIDE_INT > x.precision) hwi = zext_hwi (hwi, x.precision % HOST_BITS_PER_WIDE_INT); /* Now it's down to whether HWI is a power of 2. */