------- Comment #10 from jason at gcc dot gnu dot org 2010-04-08 15:57 ------- @7: But -Wconversion only warns if it knows the constant value, it doesn't warn about converting from an arbitrary int variable such as (importantly) a loop counter.
@5: It seems appropriate to me for VRP to optimize based on TYPE_MIN/MAX_VALUE, the problem is that the front end is lying; either we need to apply a mask on conversion to the enum, or we should set TYPE_MIN/MAX_VALUE to the appropriate values for the mode. My preference is for the latter, and it sounds like Ada made the same choice. The debugging backends don't seem to care about TYPE_MIN/MAX_VALUE for enums. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680