[Ada] Fix wrong number of iterations for specific loop
Eric Botcazou
ebotcazou@adacore.com
Tue Aug 13 16:03:00 GMT 2013
This is a regression present on all the active branches. The compiler
generates code that doesn't execute the expected number of iterations for a
loop with a dynamic upper bound whose value is exactly the upper bound of the
base index type and is obtained through a narrowing conversion.
Tested on x86_64-suse-linux, applied on all the active branches.
2013-08-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (can_equal_min_or_max_val_p): Be prepared for
values outside of the range of the type.
2013-08-13 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/loop_optimization16.adb: New test.
* gnat.dg/loop_optimization16_pkg.ad[sb]: New helper.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 574 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130813/9c9b8647/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loop_optimization16.adb
Type: text/x-adasrc
Size: 450 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130813/9c9b8647/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loop_optimization16_pkg.adb
Type: text/x-adasrc
Size: 155 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130813/9c9b8647/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loop_optimization16_pkg.ads
Type: text/x-adasrc
Size: 133 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130813/9c9b8647/attachment-0003.bin>
More information about the Gcc-patches
mailing list