This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/64946] [AArch64] gcc.target/aarch64/vect-abs-compile.c - "abs" vectorization fails for char/short types
- From: "shiva0217 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 08 Jun 2016 08:59:33 +0000
- Subject: [Bug tree-optimization/64946] [AArch64] gcc.target/aarch64/vect-abs-compile.c - "abs" vectorization fails for char/short types
- Auto-submitted: auto-generated
- References: <bug-64946-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64946
--- Comment #21 from Shiva Chen <shiva0217 at gmail dot com> ---
Hi, Richard
On following example
int a = ABS_EXPR (b);
int c = a - 1;
c will get it's range base on a which is ~[INT_MIN+1, -1]
Even if we transfer to
int a = (int) ABSU_EXPR (b);
int c = a - 1;
Therefore, c still have to consider INT_MIN.
or you mean that we could transfer like
unsigned int a = ABSU_EXPR (b);
int c = (int) (a - 1)
Then we could simplify value range analysis until convert back to int.
we could get
a : [0, -INT_MIN]
a - 1 : [0, INT_MAX] and UINT_MAX
c : [-1, INT_MAX]