This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/32309] Unnecessary conversion from short to unsigend short breaks vectorization



------- Comment #6 from pinskia at gmail dot com  2007-06-12 17:56 -------
Subject: Re:  Unnecessary conversion from short to unsigend short breaks
vectorization

On 12 Jun 2007 17:53:19 -0000, gangren at google dot com
<gcc-bugzilla@gcc.gnu.org> wrote:

> 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?

Yes, signed short has undefined overflow, while unsigned is defined as
wrapping.

--Pinski


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32309


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