This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/31710] [4.2/4.3 Regression] ICE in in set_value_range, at tree-vrp.c:278



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]