This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] SSA->normal coalescing fix.
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: 17 Feb 2004 16:01:27 -0500
- Subject: [tree-ssa] SSA->normal coalescing fix.
This fixes the bug I had last week. We should never coalesce items that are
in different TPA lists. With that fix, I've re-enabled the use of a coalesce list when going out of ssa.
Bootstrapped, no new errors, etc. on i686-pc-linux-gnu.
Andrew
2004-02-17 Andrew Macleod <amacleod@redhat.com>
* tree-ssa-live.c (coalesce_tpa_members): Don't coalesce partitions
which are not in the same TPA group.
* tree-ssa.c (rewrite_out_of_ssa): Coalesce via list first.
Index: tree-ssa-live.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-live.c,v
retrieving revision 1.1.2.35
diff -c -p -r1.1.2.35 tree-ssa-live.c
*** tree-ssa-live.c 11 Feb 2004 16:28:40 -0000 1.1.2.35
--- tree-ssa-live.c 17 Feb 2004 20:05:19 -0000
*************** coalesce_tpa_members (tpa_p tpa, conflic
*** 1506,1517 ****
print_generic_expr (debug, partition_to_var (map, y), TDF_SLIM);
}
! if (tpa_find_tree (tpa, x) == TPA_NONE
! || tpa_find_tree (tpa, y) == TPA_NONE)
{
if (debug)
{
! if (tpa_find_tree (tpa, x) == TPA_NONE)
fprintf (debug, ": Fail %d non TPA.\n", x);
else
fprintf (debug, ": Fail %d non TPA.\n", y);
--- 1506,1520 ----
print_generic_expr (debug, partition_to_var (map, y), TDF_SLIM);
}
! w = tpa_find_tree (tpa, x);
! z = tpa_find_tree (tpa, y);
! if (w != z || w == TPA_NONE || z == TPA_NONE)
{
if (debug)
{
! if (w != z)
! fprintf (debug, ": Fail, Non-matching TPA's\n");
! if (w == TPA_NONE)
fprintf (debug, ": Fail %d non TPA.\n", x);
else
fprintf (debug, ": Fail %d non TPA.\n", y);
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.199
diff -c -p -r1.1.4.199 tree-ssa.c
*** tree-ssa.c 13 Feb 2004 11:15:57 -0000 1.1.4.199
--- tree-ssa.c 17 Feb 2004 20:05:20 -0000
*************** rewrite_out_of_ssa (void)
*** 2783,2789 ****
{
var_map map;
int var_flags = 0;
! int ssa_flags = (SSANORM_REMOVE_ALL_PHIS | SSANORM_COALESCE_PARTITIONS);
eliminate_virtual_phis ();
--- 2783,2790 ----
{
var_map map;
int var_flags = 0;
! int ssa_flags = (SSANORM_REMOVE_ALL_PHIS | SSANORM_USE_COALESCE_LIST
! | SSANORM_COALESCE_PARTITIONS);
eliminate_virtual_phis ();