[Bug tree-optimization/15524] [4.0 Regression] jump threading on trees is slow with switch statements with large # of cases
kazu at cs dot umass dot edu
gcc-bugzilla@gcc.gnu.org
Mon Nov 1 19:35:00 GMT 2004
------- 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
More information about the Gcc-bugs
mailing list