This is the mail archive of the
mailing list for the GCC project.
Re: [RFA] Switch cgraph to IPA_SSA state reliably
- From: Richard Henderson <rth at redhat dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, rguenther at suse dot de
- Date: Thu, 15 Jul 2010 12:44:00 -0700
- Subject: Re: [RFA] Switch cgraph to IPA_SSA state reliably
- References: <4C3F5B72.firstname.lastname@example.org>
On 07/15/2010 12:03 PM, Richard Henderson wrote:
> I'm not sure of the logic behind switching cgraph_state in pass_all_early_optimizations.
> For whatever reason, it's not working. Simply moving the state change to
> pass_early_local_passes does the trick, however.
I figured out why the state change in pass_all_early_optimizations wasn't working:
it's not run all the time. Consider a compilation unit with no functions. E.g.
__thread int i __attribute__((common));
This test case requires a constructor, but since pass_all_early_optimizations
is run for each function and there are none, we never change state to IPA_SSA.
> Bootstrap is continuing on amd64-linux. Ok for mainline if it passes?
> - /* If pass_all_early_optimizations was not scheduled, the state of
> - the cgraph will not be properly updated. Update it now. */
> - if (cgraph_state < CGRAPH_STATE_IPA_SSA)
> - cgraph_state = CGRAPH_STATE_IPA_SSA;
> + /* We should have run pass_early_local_passes, which updated this state. */
> + gcc_assert (cgraph_state >= CGRAPH_STATE_IPA_SSA);
Ignore this hunk for the moment; it fails for all LTO tests. However, I suspect
that somewhere in the LTO path we should have set the state more correctly.