From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21478 invoked by alias); 22 May 2011 16:09:06 -0000 Received: (qmail 21447 invoked by uid 22791); 22 May 2011 16:08:52 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_FAIL X-Spam-Check-By: sourceware.org Received: from smtp-vbr16.xs4all.nl (HELO smtp-vbr16.xs4all.nl) (194.109.24.36) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 May 2011 16:08:37 +0000 Received: from [192.168.1.68] (teejay.xs4all.nl [213.84.119.160]) (authenticated bits=0) by smtp-vbr16.xs4all.nl (8.13.8/8.13.8) with ESMTP id p4MG8MHU065034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 22 May 2011 18:08:23 +0200 (CEST) (envelope-from vries@codesourcery.com) Message-ID: <4DD9348A.8030807@codesourcery.com> Date: Sun, 22 May 2011 19:33:00 -0000 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Eric Botcazou CC: gcc-patches@gcc.gnu.org, Zdenek Dvorak Subject: Re: [PATCH PR45098, 9/10] Cheap shift-add. References: <4DD21F6E.4050308@codesourcery.com> <20110518212018.GA28543@kam.mff.cuni.cz> <4DD6323B.6030308@codesourcery.com> <201105210940.41771.ebotcazou@adacore.com> In-Reply-To: <201105210940.41771.ebotcazou@adacore.com> Content-Type: multipart/mixed; boundary="------------060908000404040104060900" 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 X-SW-Source: 2011-05/txt/msg01562.txt.bz2 This is a multi-part message in MIME format. --------------060908000404040104060900 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 1467 On 05/21/2011 09:40 AM, Eric Botcazou wrote: >> 2011-05-05 Tom de Vries >> >> PR target/45098 >> * tree-ssa-loop-ivopts.c: Include expmed.h. >> (get_shiftadd_cost): New function. >> (force_expr_to_var_cost): Declare forward. Use get_shiftadd_cost. > > This breaks the Ada compiler on x86: > > /home/eric/build/gcc/native32/./gcc/xgcc -B/home/eric/build/gcc/native32/./gcc/ -B/home/eric/install/gcc/i586-suse-linux/bin/ -B/home/eric/install/gcc/i586-suse-linux/lib/ -isystem /home/eric/install/gcc/i586-suse-linux/include -isystem /home/eric/install/gcc/i586-suse-linux/sys-include -c -g -O2 -fPIC -W -Wall -gnatpg > a-calend.adb -o a-calend.o > +===========================GNAT BUG DETECTED==============================+ > | 4.7.0 20110521 (experimental) [trunk revision 173887] (i586-suse-linux-gnu) > GCC error:| > | in int_cst_value, at tree.c:9970 | > | Error detected around a-calend.adb:1254:7 > > To reproduce, do: > gcc/gnat1 gcc/ada/rts/a-calend.adb -gnatg -O -Igcc/ada/rts > in the build dir. > I didn't manage to reproduce the breakage, but I think this patch will fix it. The patch makes sure cst_and_fits_in_hwi is tested before using int_cst_value. Regtested on x86_64. Ok for trunk? 2011-05-22 Tom de Vries PR target/45098 * tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Fixed const test for call to get_shiftadd_cost. --------------060908000404040104060900 Content-Type: text/x-patch; name="pr45098-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pr45098-fix.patch" Content-length: 563 Index: gcc/tree-ssa-loop-ivopts.c =================================================================== --- gcc/tree-ssa-loop-ivopts.c (revision 173703) +++ gcc/tree-ssa-loop-ivopts.c (working copy) @@ -3683,7 +3683,7 @@ mult = op0; if (mult != NULL_TREE - && TREE_CODE (TREE_OPERAND (mult, 1)) == INTEGER_CST + && cst_and_fits_in_hwi (TREE_OPERAND (mult, 1)) && get_shiftadd_cost (expr, mode, cost0, cost1, mult, speed, &sa_cost)) return sa_cost; --------------060908000404040104060900--