[Bug target/124965] [SLP][AArch64] GCC fails to SLP-vectorize loop with conditional float-to-int reductions

bug_hunters at yeah dot net gcc-bugzilla@gcc.gnu.org
Tue Apr 21 12:39:45 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124965

Hunter X <bug_hunters at yeah dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[SLP][AArch64] GCC fails to |[SLP][AArch64] GCC fails to
                   |eliminate redundant float   |SLP-vectorize loop with
                   |*1.0 and misses SLP         |conditional float-to-int
                   |vectorization that Clang    |reductions
                   |performs                    |

--- Comment #3 from Hunter X <bug_hunters at yeah dot net> ---
(In reply to Richard Biener from comment #2)
> And without -fno-trapping-math we'd preserve the overflow exception...

Thank you for the clarification. I have re-tested with both -fno-trapping-math 
and -funsafe-math-optimizations added.

Compilation options:
-O3 -S -march=armv9-a+sve -ftree-vectorize -fno-trapping-math
-funsafe-math-optimizations -fopt-info-vec-all

Result:
<source>:9:23: missed: couldn't vectorize loop
<source>:7:9: missed: not vectorized: unsupported use in stmt.

The loop still fails legality checks with "unsupported use in stmt", never 
reaching the cost model stage. Generated assembly remains fully scalar.

Clang successfully SLP-vectorizes this pattern under the same conditions.

Updated Godbolt: [https://godbolt.org/z/8c4M3e7zc]


More information about the Gcc-bugs mailing list