https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281
--- Comment #5 from JuzheZhong ---
(In reply to JuzheZhong from comment #4)
> Confirm reduced case:
>
> #include
> unsigned char a;
>
> int main() {
> short b = a = 0;
> for (; a != 19; a++)
> if (a)
> b = 32872 >> a;
>
>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281
--- Comment #4 from JuzheZhong ---
Confirm reduced case:
#include
unsigned char a;
int main() {
short b = a = 0;
for (; a != 19; a++)
if (a)
b = 32872 >> a;
assert (b == 0);
}
with -fno-vect-cost-model -march=rv64gcv -O3:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281
--- Comment #3 from JuzheZhong ---
I think there are 2 issues here:
1. We should adjust cost model to let loop vectorizer eliminate the
unprofitable
vectorization. It should be done in RISC-V backend.
2. We should fix run fail bug with
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281
--- Comment #2 from Robin Dapp ---
Confirmed. Funny, we shouldn't vectorize that but really optimize to "return
0". Costing might be questionable but we also haven't optimized away the loop
when comparing costs.
Disregarding that, of course
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281
Patrick O'Neill changed:
What|Removed |Added
Keywords||wrong-code
CC|