This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/15524] [4.0 Regression] jump threading on trees is slow with switch statements with large # of cases
- 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: 1 Nov 2004 19:35:11 -0000
- Subject: [Bug tree-optimization/15524] [4.0 Regression] jump threading on trees is slow with switch statements with large # of cases
- References: <20040518194300.15524.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-11-01 19:34 -------
Subject: Re: [4.0 Regression] jump threading
on trees is slow with switch statements with large # of cases
Hi Steven,
> OK, then can you see if this hack helps...?
+ /* Step 4: Update the case label vector. */
+ TREE_VEC_LENGTH (label_vec) = n;
+ for (i = 0; i < n; ++i)
+ {
+ tree elt = TREE_VEC_ELT (label_vec, i);
+ e = case_to_edge[i];
+ CASE_LABEL (elt) = tree_block_label (e->dest);
+ }
Wow, this is barely safe. You are assuming that the edge redirection
is done by changing e->dest and that cfg.c:redirect_edge_succ_nodup
does not remove e, which is actually the case because there is no
existing edge from the block containing SWITCH_EXPR to the new basic
block created by split_edge.
In any case, I agree this should work. I'll be the second one to
admit this is gross. :-)
Kazu Hirata
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15524