Patch committed: Avoid IN_RANGE tests on enum values

Ian Lance Taylor iant@google.com
Fri Jun 19 18:06:00 GMT 2009


i386.c has some IN_RANGE tests on enum values.  This is fine in C, but
in C++, where enums are not simply int, it triggers -Wtype-limits
warnings.  I don't think the IN_RANGE tests are the right approach
anyhow, since it means that if the type of the field changes we have to
change the test.  It's better to test that storing th value in the fild
does not change the value.  That is what I implemented in this patch.

Bootstrapped and tsted on x86_64-unknown-linux-gnu.  Committed.

Ian


2009-06-19  Ian Lance Taylor  <iant@google.com>

	* config/i386/i386.c (ix86_function_specific_save): Test that
	fields match values, rather than testing the values are in a
	certain range.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 1234 bytes
Desc: Avoid IN_RANGE tests
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090619/d7765bc0/attachment.bin>


More information about the Gcc-patches mailing list