This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/17895] [4.0 Regression] tree CFG cleanup is slow
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Oct 2004 03:20:11 -0000
- Subject: [Bug middle-end/17895] [4.0 Regression] tree CFG cleanup is slow
- References: <20041008193659.17895.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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