This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/32309] Unnecessary conversion from short to unsigend short breaks vectorization
- From: "gangren at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jun 2007 18:10:00 -0000
- Subject: [Bug tree-optimization/32309] Unnecessary conversion from short to unsigend short breaks vectorization
- References: <bug-32309-14687@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from gangren at google dot com 2007-06-12 18:10 -------
(In reply to comment #6)
> 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
>
Thanks. So even if the underlining architecture does not trigger an overflow on
signed short (like AltiVec if I remember correctly), we still need to have such
conversions? In addition, does "undefined overflow" include "no overflow"?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32309