http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56223
Bug #: 56223 Summary: Integer ABS is not recognized for more complicated pattern Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: ysrum...@gmail.com In one important benchmark the following ABS pattern which is not recognized by gcc was found: if (x >= 0) s += x; else s -= x; that certainly should be converted to ABS as e.g. icc does. In result the loop containing this pattern is not vectorized on x86 and arm. I attached simple test-case to reproduce it. If we complile it for atom with options " -O3 -m32 -march=atom2 -mtune=atom2 -ffast-math -msse2 -mfpmath=sse -ftree-vectorizer-verbose=2" we got: ... t5.c:1: note: vectorized 0 loops in function. ... t5.c:15: note: vectorized 1 loops in function.