This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12237] wrong code generated due to wrong static evaluation of a signed/unsigned comparison
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Sep 2003 11:06:28 -0000
- Subject: [Bug c/12237] wrong code generated due to wrong static evaluation of a signed/unsigned comparison
- References: <20030910103851.12237.philippe.coucaud@antevista.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12237
ebotcazou at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
------- Additional Comments From ebotcazou at gcc dot gnu dot org 2003-09-10 11:06 -------
Quoting ISO C99:
§6.3.1.8 Usual arithmetic conversions
#1 [...] Otherwise, the integer promotions are performed on both operands.
Then the following rules are applied to the promoted operands:
[...]
Otherwise, if the operand that has unsigned
integer type has rank greater or equal to the rank
of the type of the other operand, then the operand
with signed integer type is converted to the type
of the operand with unsigned integer type.