[Bug middle-end/98817] Optimize if (a != b) a = b;
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 25 09:41:10 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98817
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
cmov has the exact same problem as the unconditional store. At least on x86 a
cmov for one doesn't have a MEM destination and so the conditionally assigned
register then needs to be unconditionally stored.
You'd need an instruction that would store only if the condition is true
(something like SSE/AVX masked stores, but for scalars).
More information about the Gcc-bugs
mailing list