This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Mainline bootstrap failure on hppa2.0w-hp-hpux11.00


John David Anglin <dave@hiauly1.hia.nrc.ca> writes:

> I read in 6.3.1.8 which discusses the usual arithmetic conversions,

> 	Otherwise, if the type of the operand with the signed integer
> 	can represent all of the values of the type of the operand
> 	with unsigned integer type, then the operand with unsigned
> 	integer type is converted to the type of the operand with
> 	signed integer type.

> It seems as if this would apply to the case in question.

It does, and it mandates that the int argument be promoted to unsigned.
It's important to read the beginning entirely literally:  "if the *type*
of the operand with the signed integer can represent all of the values of
the *type* of the operand with the unsigned integer type...".  int cannot
represent all of the values of unsigned int, therefore both values are
promoted to unsigned int.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]