[Bug tree-optimization/32309] Unnecessary conversion from short to unsigend short breaks vectorization
gangren at google dot com
gcc-bugzilla@gcc.gnu.org
Tue Jun 12 17:53:00 GMT 2007
------- Comment #5 from gangren at google dot com 2007-06-12 17:53 -------
(In reply to comment #3)
> >Do you mean that short_var + short_var is defined as
> > (short)((unsigned short)short_var + (unsigned short)short_var)?
>
> Kinda, because it is really defined by the C standard as:
> (short)((int)short_var + (int)short_var)
> And then GCC's middle-end optimizes it to:
> (short)((unsigned short)short_var + (unsigned short)short_var)
>
> *** This bug has been marked as a duplicate of 26128 ***
>
I'm aware of integral promotion. But not quite understand why we can optimize
(short)((int)short_var + (int)short_var) to (short)((unsigned short)short_var +
(unsigned short)short_var), but not to (short)((short)short_var +
(short)short_var)? Is it because unsigned short has different overflow
handling?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32309
More information about the Gcc-bugs
mailing list