From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3081 invoked by alias); 22 May 2011 18:01:37 -0000 Received: (qmail 3072 invoked by uid 22791); 22 May 2011 18:01:36 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_40,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 May 2011 18:01:23 +0000 Received: by wwf26 with SMTP id 26so5052280wwf.8 for ; Sun, 22 May 2011 11:01:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.55.74 with SMTP id t10mr1467900wbg.91.1306087281879; Sun, 22 May 2011 11:01:21 -0700 (PDT) Received: by 10.227.38.129 with HTTP; Sun, 22 May 2011 11:01:21 -0700 (PDT) In-Reply-To: <4DD9348A.8030807@codesourcery.com> References: <4DD21F6E.4050308@codesourcery.com> <20110518212018.GA28543@kam.mff.cuni.cz> <4DD6323B.6030308@codesourcery.com> <201105210940.41771.ebotcazou@adacore.com> <4DD9348A.8030807@codesourcery.com> Date: Sun, 22 May 2011 20:22:00 -0000 Message-ID: Subject: Re: [PATCH PR45098, 9/10] Cheap shift-add. From: Richard Guenther To: Tom de Vries Cc: Eric Botcazou , gcc-patches@gcc.gnu.org, Zdenek Dvorak Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg01566.txt.bz2 On Sun, May 22, 2011 at 6:06 PM, Tom de Vries wrot= e: > On 05/21/2011 09:40 AM, Eric Botcazou wrote: >>> 2011-05-05 =A0Tom de Vries =A0 >>> >>> =A0 =A0 =A0PR target/45098 >>> =A0 =A0 =A0* tree-ssa-loop-ivopts.c: Include expmed.h. >>> =A0 =A0 =A0(get_shiftadd_cost): New function. >>> =A0 =A0 =A0(force_expr_to_var_cost): Declare forward. =A0Use get_shifta= dd_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/in= clude -isystem /home/eric/install/gcc/i586-suse-linux/sys-include =A0 =A0-c= -g -O2 =A0-fPIC =A0-W -Wall -gnatpg >> a-calend.adb -o a-calend.o >> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3DGNAT BUG DETECTED=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ >> | 4.7.0 20110521 (experimental) [trunk revision 173887] (i586-suse-linux= -gnu) >> GCC error:| >> | in int_cst_value, at tree.c:9970 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | >> | Error detected around a-calend.adb:1254:7 >> >> To reproduce, do: >> =A0 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 fi= x it. > > The patch makes sure cst_and_fits_in_hwi is tested before using int_cst_v= alue. > > Regtested on x86_64. > > Ok for trunk? Ok. Thanks, Richard. > 2011-05-22 =A0Tom de Vries =A0 > > =A0 =A0 =A0 =A0PR target/45098 > =A0 =A0 =A0 =A0* tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Fixed c= onst test > =A0 =A0 =A0 =A0for call to get_shiftadd_cost. >