]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end: guard against non-single use compares in emit_cmp_and_jump_insns
authorTamar Christina <tamar.christina@arm.com>
Wed, 26 Nov 2025 22:00:07 +0000 (22:00 +0000)
committerTamar Christina <tamar.christina@arm.com>
Wed, 26 Nov 2025 22:00:07 +0000 (22:00 +0000)
commitb11ae5fb5efcf9e0977cd54538765e1d40b1b107
tree3c0e775084d4edc71462f34323d178b6a16e95da
parentedb025aebf799d539d9a0f56993f3cc48f9beb5b
middle-end: guard against non-single use compares in emit_cmp_and_jump_insns

When I wrote this optimization my patch stack included a change in
tree-out-of-ssa that would duplicate the compares such that the
use is always single use and get_gimple_for_ssa_name would always
succeed.

However I have dropped that for GCC 16 since I didn't expect the
vectorizer to be able to produce duplicate uses of the same
compare results.

But I neglected that you can get it by other means.  So this simply
checks that get_gimple_for_ssa_name succeeds for the LEN cases.
The non-LEN cases already check it earlier on.

To still get the optimization in this case the tree-out-of-ssa
change is needed, which is staged for next stage-1.

gcc/ChangeLog:

* optabs.cc (emit_cmp_and_jump_insns): Check for non-single use.
gcc/optabs.cc