This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lto] fix PR40758 (an ICE)
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 26 Sep 2009 12:58:07 +0200
- Subject: Re: [lto] fix PR40758 (an ICE)
- References: <Pine.LNX.4.64.0909260323510.15566@wotan.suse.de>
On Sat, Sep 26, 2009 at 3:29 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> the issue here is that we blindly add SSA names to the used_in_copies
> bitmap in the !optimize case in order to try to coalesce all SSA names of
> the same base var. ?That is all fine and well (there are no issues with
> overlapping life ranges as speculated in the bug report), except that we
> can only add names that are actually mentioned in the IR, using the same
> predicate that also is used by partition_view_init (it either has to be a
> real def or have some uses).
>
> This patch fixes the testcase. ?I'm regstrapping it on trunk, not LTO
> branch, and like to have approval for trunk, it's also a bug there.
>
> The testcase from the bugreport only works for LTO, of course. ?Somebody
> more knowledgeable than me might want to add it there when merging
> everything.
This might also fix PR41470 - heh, notice the similarity of the patches ;)
So please add the testcase from that PR instead.
Ok for trunk with that.
Thanks,
Richard.
>
> Ciao,
> Michael.
> --
> ? ? ? ?PR lto/40758
> ? ? ? ?* tree-ssa-coalesce.c (coalesce_ssa_name): Add only SSA names
> ? ? ? ?that are mentioned in the body.
>
> Index: tree-ssa-coalesce.c
> ===================================================================
> --- tree-ssa-coalesce.c (Revision 152187)
> +++ tree-ssa-coalesce.c (Arbeitskopie)
> @@ -1377,7 +1377,10 @@ coalesce_ssa_name (void)
> ? ? ? ?{
> ? ? ? ? ?tree a = ssa_name (i);
>
> - ? ? ? ? if (a && SSA_NAME_VAR (a) && !DECL_ARTIFICIAL (SSA_NAME_VAR (a)))
> + ? ? ? ? if (a
> + ? ? ? ? ? ? && SSA_NAME_VAR (a)
> + ? ? ? ? ? ? && !DECL_ARTIFICIAL (SSA_NAME_VAR (a))
> + ? ? ? ? ? ? && (!has_zero_uses (a) || !SSA_NAME_IS_DEFAULT_DEF (a)))
> ? ? ? ? ? ?{
> ? ? ? ? ? ? ?tree *slot = (tree *) htab_find_slot (ssa_name_hash, a, INSERT);
>
>