On Thu, Mar 12, 2009 at 12:46, Steven Bosscher <stevenb....@gmail.com> wrote: > On Thu, Mar 12, 2009 at 5:36 PM, Diego Novillo <dnovi...@google.com> wrote: >> The temptation is to use C++'s limits, but I'm concerned that may >> produce confusion somewhere down the line with the optimizers or other >> diagnostics. Or should we use C's notion and treat them as ints? > > The limits are a language-specific thing that the front end should check for.
Right, but we do take advantage of them in the middle end in various places (VRP, switch warnings, etc). Using one or the other will probably affect what we do there. I have no data on whether this is true, though, it's only intuition from the fact that we do make decisions based in TYPE_{MAX,MIN}_VALUE. > But from the point of view of the middle-end, an enum value is just a > number. So IMHO: Use ints. That's true. Diego.