This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Why are bools cast to int in conditionals?
On Wed, 21 Apr 2004, Dan Nicolaescu wrote:
> > Here, the usual arithmetic conversions are applied to the operands of !=,
> > which includes the integer promotions, which promote _Bool to int.
>
> Is _Bool different from other types in this respect? short, chars and
> enums don't seem to get the same treatment.
Perhaps some optimization is allowing INTEGER_TYPE but not BOOLEAN_TYPE.
Various optimizations of operations on promoted types are presently in
build_binary_op and shorten_compare.
--
Joseph S. Myers
jsm@polyomino.org.uk