https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102483
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|tree-optimization |target Status|UNCONFIRMED |NEW Last reconfirmed| |2021-09-25 Target| |x86_64-linux-gnu Summary|Regression in codegen of |Reduction of 4 chars can be |reduction of 4 chars |improved Ever confirmed|0 |1 Keywords| |missed-optimization --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. There is a cost model issue as the backend does not implement a reduction add for vector(4) char. Note just a slightly different function (doing a store rather than a return) produces way different results too (even on LLMV): void foo (unsigned char* p, unsigned char *t) { char sum = 0; for (int i = 0; i != 4; i++) sum += p[i]; *t= sum; }