This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/31710] [4.2/4.3 Regression] ICE in in set_value_range, at tree-vrp.c:278
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Apr 2007 03:52:28 -0000
- Subject: [Bug middle-end/31710] [4.2/4.3 Regression] ICE in in set_value_range, at tree-vrp.c:278
- References: <bug-31710-3760@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from ian at airs dot com 2007-04-27 04:52 -------
Created an attachment (id=13453)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13453&action=view)
Proposed patch
This is an interesting test case. It turns out that VRP has always
consistently assumed that TREE_TYPE (TYPE_MIN_VALUE (t)) == t. The assumption
turns up in == comparisons against TYPE_MIN_VALUE (and TYPE_MAX_VALUE). Those
== comparisons are normally valid because we hash integer constants so that
they are all the same. The hash includes the type. So when TREE_TYPE
(TYPE_MIN_VALUE (t)) != t, the equality will actually never hold, and VRP will
do the wrong thing.
This patch simply ensures that the equality holds. I'm testing it now.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31710