This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/37005] [4.4 Regression] GNAT Bug Box for cd2a24e.adb:37 at tree-vrp.c:392
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Aug 2008 15:27:48 -0000
- Subject: [Bug tree-optimization/37005] [4.4 Regression] GNAT Bug Box for cd2a24e.adb:37 at tree-vrp.c:392
- References: <bug-37005-296@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from rguenth at gcc dot gnu dot org 2008-08-27 15:27 -------
The FE generates
if ((SAVE_EXPR <cd2a24e__ident ((integer) c1)> < c1 || SAVE_EXPR
<cd2a24e__ident ((integer) c1)> > c2) || cd2a24e__ident (4) <= 3 && c2 > 2)
{
where c2 is of type cd2a24e__check_type (an enum with the range [3, 5]).
As you can see the comparison is against a value of different type (actually
it's of the same type, but it is out-of-range).
VRP generates a fallback range using TYPE_MIN_VALUE producing [3, 2] which
leads to the ICE.
This out-of-range comparison is generated by fold from 3 <= c2 during
canonicalization.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37005