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/64946] [AArch64] gcc.target/aarch64/vect-abs-compile.c - "abs" vectorization fails for char/short types


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]

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