[Bug tree-optimization/18133] computed gotos are not folded back to regual gotos when it is found it is not a computed goto at all
steven at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sun Oct 24 23:52:00 GMT 2004
------- Additional Comments From steven at gcc dot gnu dot org 2004-10-24 23:52 -------
Fixing this is easy
for all bb
if bb ends in a computed goto
(which on tree means there is *only* a computed goto)
find the computed goto target
if the target is an SSA_NAME and the SSA_NAME_DEF_STMT is a PHI node
go through all the PHI nodes, and if one is the address of a label
let bb be the source block of the edge for the constant PHI argument
let label be the PHI argument
ssa_remove_edge all outdoing edges of bb
add a new edge to block_for_label(label)
update the GOTO_TARGET to be label
This probably should be folded into cleanup_control_flow.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18133
More information about the Gcc-bugs
mailing list