[Bug middle-end/17895] [4.0 Regression] tree CFG cleanup is slow

kazu at cs dot umass dot edu gcc-bugzilla@gcc.gnu.org
Wed Oct 13 03:20:00 GMT 2004


------- Additional Comments From kazu at cs dot umass dot edu  2004-10-13 03:20 -------
tree_redirect_edge_and_branch needs O(n) time to redirect an edge of
a SWITCH_EXPR in the worst case, where n is the number of case labels
in a SWITHC_EXPR.

Therefore, redirecting O(n) edges costs O(n^2) in time.

Given an index to SWITCH_LABELS, we can get the corresponding edge in
constant time.

However, given an edge, we have to go through all of SWITCH_LABELS to find
an index to SWITCH_LABELS.

We could perhaps store an index to SWITCH_LABELS in an edge.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17895



More information about the Gcc-bugs mailing list