This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PING: [PATCH] Fix PR 20972


Bernd Schmidt wrote:
one that is initialized. However, a register may not only appear to be uninitialized, it can actually be used uninitialized, as in Josh's testcase.

I think this should be fixed by not having any used uninitialized registers. We already have some code in flow that tries to initialize registers that are used uninitialized. See the initialize_uninitialized_subregs function. It could be expanded to handle cases like this.


In this particular case, the input testcase is invalid, it uses an uninitialized variable, so it doesn't really matter how we handle it. However, we also get similar code for bitfield references due to the fact that tree-ssa decomposes structure assignments, and the middle-end doesn't handle the resulting trees efficiently.

We get two benefits from initialized registers that are used uninitialized:
1) We get better optimization, because we can now simplify operations using the uninitialized registers. This is particularly useful for structure field assignments, as they may simplify from a bit-field insertion to a simple move.
2) We avoid IA-64 illegal instruction faults. Any uninitialized register is a register that might have the NaT bit set, and if we use that register in an instruction with non-reversible side-effects (like store or load), then we get an illegal instruction fault.


I have a PR with an IA-64 and x86-64 testcases for this, see PR 21111.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]