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]

Fix for pr18888


pr18888 is a bug in how we update the conflict graph in
coalesce_abnormal_edges.

The API for the code to update the conflict graph needs to
distinguish between source and target partitions.  ie, it
adds the conflicts from the source partition to the target
partition.

The tree-ssa code typically does something like this when it is
going to merge partitions:

x = partition_to_var (map, part1);
y = partition_to_var (map, part2);
z = var_union (x, y);

if (z == x)
  conflict_graph_merge_regs (graph, x, y);
else
  conflict_graph_merge_regs (graph, y, x);


Where z is the representative variable for the union of
the partitions. 


coalesce_abnormal_edges didn't have this kind of code and just
blindly assumed "X" would be the target partition and thus added
the conflicts from "Y" to "X".

Needless to say this didn't work well when "Y" was supposed to
be the target partition.  The net effect is that "Y" is missing
conflicts.  This in turn allowed coalescing of other objects into
"Y"'s partition that conflicted with "X" (and thus should have
conflicted with "Y" after merging X & Y).

Bootstrapped and regression tested on i686-pc-linux-gnu.



Attachment: PPP
Description: Text document


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