[Bug target/78037] Incorrect code generated at optimization level -O2 for tzcnt and binary and
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Oct 20 11:18:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78037
--- Comment #17 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Jakub Jelinek from comment #13)
> The problem is that on x86 clz/ctz is sometimes undefined and sometimes
> defined at zero, it depends on which instruction is used and which CPU too.
> If we emit bsf/bsr etc., it is undefined, if we emit tzcnt/lzcnt aka
> rep;bsf/rep;bsr, it is undefined if it is run on CPUs without BMI and
> defined on CPUs with BMI.
Please note that alhough we emit tzcnt (aka rep bsf) also for TARGET_GENERIC,
we claim CTZ_DEFINED_VALUE_AT_ZERO only for TARGET_BMI.
More information about the Gcc-bugs
mailing list