This is the mail archive of the gcc-bugs@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]

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


------- 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


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