This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH PR45098, 9/10] Cheap shift-add.
On Sun, May 22, 2011 at 6:06 PM, Tom de Vries <vries@codesourcery.com> wrote:
> On 05/21/2011 09:40 AM, Eric Botcazou wrote:
>>> 2011-05-05 ?Tom de Vries ?<tom@codesourcery.com>
>>>
>>> ? ? ?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?
Ok.
Thanks,
Richard.
> 2011-05-22 ?Tom de Vries ?<tom@codesourcery.com>
>
> ? ? ? ?PR target/45098
> ? ? ? ?* tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Fixed const test
> ? ? ? ?for call to get_shiftadd_cost.
>