------- Comment #5 from rguenth at gcc dot gnu dot org 2006-04-26 09:55 ------- It does not even respect unsigned overflow:
if (val1 == TYPE_MAX_VALUE (TREE_TYPE (val1)) && TREE_CODE (val2) == MINUS_EXPR) /* +INF > NAME - CST. */ return 1; for NAME == 0 and CST == 1 this will return 1 even if NAME - CST is +INF. Now, luckily fold will transform that into NAME != CST-1 before VRP sees this, but compare_values looks like it completely disregards possible overflow. And of course negative integer constants. But that's another story. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25148