ppc64 --track-origins=yes failure because of bad cmov addHRegUse
commitfb6a77ed78876083e8ba4c2f92384db5c2e41be8
authorMark Wielaard <mark@klomp.org>
Tue, 8 Feb 2022 15:36:08 +0000 (8 16:36 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 8 Feb 2022 15:41:10 +0000 (8 16:41 +0100)
tree59e48be225401938a6ca4732175728c360954459
parentab740a1741322b6d0a02ea00499c2497e35e7022
ppc64 --track-origins=yes failure because of bad cmov addHRegUse

For Pin_CMov getRegUsage_PPCInstr called addHRegUse for the dst
register with HRmWrite, but since this is a conditional move the
register could be both read and written (read + write = modify).
This matches the dst of Pin_FpCMov and Pin_AvCMov.

In a very rare case, and only with --track-origins=yes, this
could cause bad code generation.

This is slightly amazing, this code is from 2005 and as far as
I know we never seen an issue with --track-origins=yes on power
before. And I have been unable to come up simple reproducer.

https://bugs.kde.org/show_bug.cgi?id=449672
NEWS
VEX/priv/host_ppc_defs.c