[Bug target/84524] -O3 causes behavior change
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 23 09:43:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84524
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It reproduces even with __attribute__((noipa)) on foo, so the problem is just
in that function. In assembly we can see:
vpsllw $8, %zmm6, %zmm5
addq $64, %rdi
vpmovzxwd %ymm5, %zmm0
vpcmpgtw %zmm5, %zmm2, %k1
vpslld $1, %zmm0, %zmm1
vextracti64x4 $0x1, %zmm5, %ymm0
vpmovzxwd %ymm0, %zmm0
vpslld $1, %zmm0, %zmm0
vpermt2w %zmm0, %zmm4, %zmm1
vpsllw $9, %zmm6, %zmm0
vpaddw %zmm7, %zmm6, %zmm6
vpxorq %zmm3, %zmm1, %zmm0
vpmovzxwd %ymm0, %zmm1
vpcmpgtw %zmm0, %zmm2, %k1
vpslld $1, %zmm1, %zmm5
vextracti64x4 $0x1, %zmm0, %ymm1
the compares into %k1 are useless, nothing really uses the %k1 afterwards, but
it should be used for conditional moves (the cond ? (v << 1) ^ 0x1021 : (v <<
9)
conditional moves). Looking into this.
More information about the Gcc-bugs
mailing list