From patchwork Sat Jun 9 12:47:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenneth Zadeck X-Patchwork-Id: 163919 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]) by ozlabs.org (Postfix) with SMTP id 5119EB6FCA for ; Sat, 9 Jun 2012 22:47:35 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1339850856; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=3zvy1HG36Vbc5PPSMyFU0iOrAGI=; b=XrQbG8iSy3ItoaR hyQ9ZJSSuc/Jxpc4y1q/pPm9MSn40Cv5hsECSu7QI7wg+WiSSUAix/7BxInHOHwu pYQ8KSscYJYpmiIBbrP9QmOj4h/YKauysb14x9isri6CG3IWwyloXvngCxAqCNG9 8QSAiJUBNw4cmuER87NT5+trit+U= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding:X-Gm-Message-State:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=do4CfeMLuCI+yabssFxS93v8lMJ6uGw+AnKIdfXa5U5ASrPZw7xw/0FB+/Spm6 S3KUmjZWE6Nok+ZxZVjEa0xdIKY84RYCxfF9C96ikgaGshj2bBbNXYjY6SDXBsGR r5QIAyjzbRpxby4WhGnezKF35NJQ5wcOqxumlqEi6xYNs=; Received: (qmail 7182 invoked by alias); 9 Jun 2012 12:47:20 -0000 Received: (qmail 7031 invoked by uid 22791); 9 Jun 2012 12:47:19 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qa0-f47.google.com (HELO mail-qa0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 09 Jun 2012 12:47:06 +0000 Received: by qabg1 with SMTP id g1so1170248qab.20 for ; Sat, 09 Jun 2012 05:47:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=gGF1N8baZWXHyHdhF4+660BZ8b5XEncy31h+B47Q8Hc=; b=NpMgTPuHbhG1S4EdfQDUpZPgi1ekyHAANqD/8iJpjv+yJtqtdhR3LlfUutluw7vBeH 6QJ2ck28F7WPsjc18pTvcCxUdIYGceQwPgJ/CR1wwa3BSmTz8YLu9xquP3j7J3AKLfjG UfsCB3XCKlZ5kVYEYN1u5L+jMjdOFoBZtojn2S1t2N2pSIBdo0dUZbA1tEU2XM20NOXt OX5ATexGXNb8nfoqrS1Ba5mbhNldXQaSZ9py0EVao7pVQStojpEpKfpdJAR4Ke832vQg TkpgKo/ZPFZgm6Vxw1DgWgY0plRGGOfjEfbNY1cK/DwDtlknUTZwZ6Kb3Y14DBGR4UWf dpXA== Received: by 10.229.136.8 with SMTP id p8mr3281554qct.132.1339246025365; Sat, 09 Jun 2012 05:47:05 -0700 (PDT) Received: from [192.168.1.10] (pool-98-113-149-59.nycmny.fios.verizon.net. [98.113.149.59]) by mx.google.com with ESMTPS id dr1sm16383538qab.2.2012.06.09.05.47.04 (version=SSLv3 cipher=OTHER); Sat, 09 Jun 2012 05:47:04 -0700 (PDT) Message-ID: <4FD345C7.6080104@naturalbridge.com> Date: Sat, 09 Jun 2012 08:47:03 -0400 From: Kenneth Zadeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: gcc-patches Subject: obvious fix to simplify-rtx.c X-Gm-Message-State: ALoCoQlD1SfxyFaUefzl2MmoTL0fsb/l9M0IoIbI9YfWipAlTrAAcbcBJohXF5umKEGLC0P9eZC1 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 The shift count was being truncated by the wrong amount. It is now zero extended from log2 of the mode size rather than the mode size. This is a (mostly) obvious fix - iant needed a hint to see what was wrong. The location of this code meant that this would be a very rare bug: only ti mode shifts on an llp64 platform. bootstrapped and regression tested on x86-64. committed as revision 188359. Kenny 2012-06-09 Kenneth Zadeck * simplify-rtx.c (simplify_const_binary_operation): Fixed shift count trucation. Index: gcc/simplify-rtx.c =================================================================== --- gcc/simplify-rtx.c (revision 188350) +++ gcc/simplify-rtx.c (working copy) @@ -3653,7 +3653,10 @@ simplify_const_binary_operation (enum rt unsigned HOST_WIDE_INT cnt; if (SHIFT_COUNT_TRUNCATED) - o1 = double_int_zext (o1, GET_MODE_PRECISION (mode)); + { + o1.high = 0; + o1.low &= GET_MODE_PRECISION (mode) - 1; + } if (!double_int_fits_in_uhwi_p (o1) || double_int_to_uhwi (o1) >= GET_MODE_PRECISION (mode))