[PATCH] Fix ICE in Tree-VRP
Eric Botcazou
ebotcazou@adacore.com
Fri May 5 21:39:00 GMT 2006
Hi,
The compiler ICEs at -O2 on the attached testcase, a regression from 3.x:
eric@linux:~/build/gcc/native32> gcc/xgcc -Bgcc -S -O2 tti0.adb -Igcc/ada/rts
+===========================GNAT BUG DETECTED==============================+
| 4.2.0 20060503 (experimental) (i586-suse-linux-gnu) GCC error: |
| in set_value_range, at tree-vrp.c:157 |
| Error detected at tti0.adb:39:4 |
The relevant statement is:
if Least_Significant < Most_Significant then
Least_Significant := Most_Significant;
end if;
Both Least_Significant and Most_Significant are Boolean and VRP computes that
Least_Significant is equal to True (1). When the pass is extracting the
range from the associated ASSERT expression, it builds a range of the form
[MIN+1, MAX] but here we have MIN == MAX so set_value_range aborts.
The proposed fix is to set the range to VARYING in this case. I don't think
something more sophisticated would be worthwhile as all should be optimized
away in the branch.
Tested on x86_64-suse-linux. OK for mainline and 4.1 branch?
2006-05-05 Eric Botcazou <ebotcazou@adacore.com>
* tree-vrp.c (extract_range_from_assert): Set the range to VARYING
for LT and GT if the computed range is effectively empty.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: f504-016.diff
Type: text/x-diff
Size: 2115 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060505/5b4f5667/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tti0.adb
Type: text/x-adasrc
Size: 695 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060505/5b4f5667/attachment-0001.bin>
More information about the Gcc-patches
mailing list