[Bug tree-optimization/64946] [AArch64] gcc.target/aarch64/vect-abs-compile.c - "abs" vectorization fails for char/short types

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Thu Jun 2 09:32:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64946

--- Comment #13 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 2 Jun 2016, shiva0217 at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64946
> 
> Shiva Chen <shiva0217 at gmail dot com> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |shiva0217 at gmail dot com
> 
> --- Comment #12 from Shiva Chen <shiva0217 at gmail dot com> ---
> It seems that the patch was dropped according to 
> https://gcc.gnu.org/ml/gcc-patches/2016-01/msg00610.html.
> 
> Could we use TYPE_OVERFLOW_UNDEFINED to guard the transformation
> like other place in gcc did ?

You can use TYPE_OVERFLOW_WRAPS to guard it.

> Any thoughts?

Elsewhere I suggested to introduce a ABSU_EXPR (or overload ABS_EXPR)
to make the result unsigned and thus effectively make ABSU_EXPR (INT_MIN)
well-defined via doing the transform

  ABS_EXPR (x) -> (typeof x) ABSU_EXPR (x)

which you then can narrow.

Other than that only making signed types >= int have undefined overflow
may be appealling as well.


More information about the Gcc-bugs mailing list