This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: basic VRP min/max range overflow question
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: Paul Schlie <schlie at comcast dot net>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Fri, 17 Jun 2005 14:10:35 +0200
- Subject: Re: basic VRP min/max range overflow question
- References: <BED82DB3.A845%schlie@comcast.net>
[#1] The signed C integer types int, long, long long and the
corresponding unsigned types are compatible with LIA-1. If an
implementation adds support for the LIA-1 exceptional values
integer_overflow and undefined, then those types are LIA-1
conformant types.
They need not wrap around. People that are actually on the C standards
committee have told you this multiple times.
C's unsigned integer types are "modulo" in the
LIA-1 sense in that overflows or out-of-bounds results silently
wrap. An implementation that defines signed integer types as also
being modulo need not detect integer overflow, in which case,
only integer divide-by-zero need be detected.
This is different from signed types. Actually I was wrong,
[10U, UINT_MAX] + [ 1U, 1U ] == ~[ UINT_MIN + 1, 10U ]
Paolo