public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* PR 23046.  Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE
@ 2005-08-05 14:00 Diego Novillo
  2005-08-05 16:35 ` Roger Sayle
  2005-08-05 17:58 ` Jeffrey A Law
  0 siblings, 2 replies; 7+ messages in thread
From: Diego Novillo @ 2005-08-05 14:00 UTC (permalink / raw)
  To: Roger Sayle; +Cc: gcc

In PR 23046 we ICE inside tree-vrp.c because fold() does not
realize that for

enum enumtype { ENUM1, ENUM2 } x;

the predicate 'if (x > 1)' is always false.  This causes VRP to
create the impossible range [2, 1] for that predicate.

While it would be trivial for VRP to paper over this problem, the
real fix should be in fold().  I looked at the logic that detects
these cases and it is fairly convoluted (fold-const.c:9174).

I'm wondering why doesn't fold() just use TYPE_MAX_VALUE/TYPE_MIN_VALUE
if they're available?


Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-08-05 21:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-05 14:00 PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE Diego Novillo
2005-08-05 16:35 ` Roger Sayle
2005-08-05 17:58 ` Jeffrey A Law
2005-08-05 20:04   ` PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE (Ada RFC) Richard Henderson
2005-08-05 20:15     ` Florian Weimer
2005-08-05 20:56       ` Richard Henderson
2005-08-05 21:04         ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).