On 06/29/2015 07:15 PM, Jim Wilson wrote:
This is my suggested fix for PR 65932, which is a linux kernel
miscompile with gcc-5.1.
The problem here is caused by a chain of events. The first is that
the relatively new eipa_sra pass creates fake parameters that behave
slightly differently than normal parameters. The second is that the
optimizer creates phi nodes that copy local variables to fake
parameters and/or vice versa. The third is that the ouf-of-ssa pass
assumes that it can emit simple move instructions for these phi nodes.
And the fourth is that the ARM port has a PROMOTE_MODE macro that
forces QImode and HImode to unsigned, but a
TARGET_PROMOTE_FUNCTION_MODE hook that does not. So signed char and
short parameters have different in register representations than local
variables, and require a conversion when copying between them, a
conversion that the out-of-ssa pass can't easily emit.
So if these "copies" require a conversion, then isn't it fundamentally
wrong to have a PHI node which copies between them? That would seem to
implicate the eipa_sra pass as needing to be aware of these promotions
and avoid having these objects with different representations appearing
on the lhs/rhs of a PHI node.
Jeff