basic VRP min/max range overflow question

Paolo Bonzini bonzini@gnu.org
Fri Jun 17 07:03:00 GMT 2005


Paul Schlie wrote:
> Upon a potential integer overflow of either it's min or max range,
> shouldn't the result be set to [min:type-min-value, max:type-max-value],
> without the necessity of any further designations?

No.

[10, INT_MAX] + [ 1, 1 ] == [ 11, INT_MAX ] because of the famous signed 
int overflow definition in the C standard.

[10U, UINT_MAX] + [ 1U, 1U ] == ~[ 1U, 10U ]

Paolo



More information about the Gcc mailing list