diff options
author | Jason Merrill <jason@redhat.com> | 2003-09-11 15:19:49 +0000 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2003-09-11 15:19:49 +0000 |
commit | d5d2f8eb92995de11f06b787b7ca4deb8cf53831 (patch) | |
tree | 107807d8770d90e0ad07fd8615c816fd542335f6 /gcc/testsuite/g++.dg | |
parent | 64b8786c17bbb1f135a330acd7836031eaa8d4c5 (diff) |
Make EDGE_FALLTHRU meaningful for tree-cfg.
* tree-cfg.c (make_edges): Set EDGE_FALLTHRU on fallthrough edge.
(make_exit_edges): Likewise.
(make_ctrl_stmt_edges): Don't set EDGE_FALLTHRU on edges into a
control structure.
(handle_switch_fallthru): Clear EDGE_FALLTHRU after inserting a goto.
(find_insert_location): Only insert after a CALL_EXPR or MODIFY_EXPR.
(bsi_insert_on_edge_immediate): Count outgoing abnormal edges.
Insert before all control stmts.
(bsi_link_after): Handle a block with nops after the last stmt.
Rename some things to clarify difference between "control structures"
(i.e. COND_EXPR) and "control statements" (also GOTO_EXPR).
* basic-block.h (BB_CONTROL_STRUCTURE): Rename from BB_CONTROL_EXPR.
* tree-cfg.c (REMOVE_NON_CONTROL_STRUCTS): Rename from
REMOVE_NON_CONTROL_STMTS.
(REMOVE_CONTROL_STRUCTS): Rename from REMOVE_CONTROL_STMTS.
(make_ctrl_stmt_edges): Move GOTO_EXPR/RETURN_EXPR handling here...
(make_exit_edges): ...from here.
(is_ctrl_altering_stmt): Don't accept GOTO_EXPR/RETURN_EXPR.
(is_ctrl_structure): Renamed from old is_ctrl_stmt.
(is_ctrl_stmt): New fn.
(bsi_move_to_bb_end): Use it.
(stmt_starts_bb_p): Use is_ctrl_stmt and is_ctrl_altering_stmt.
* tree-flow.h: Add prototype.
* tree-ssa-ccp.c, tree-ssa-dom.c: Update for name changes.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@71306 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r-- | gcc/testsuite/g++.dg/ext/label3.C | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/label3.C b/gcc/testsuite/g++.dg/ext/label3.C new file mode 100644 index 00000000000..be40f264d5c --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/label3.C @@ -0,0 +1,38 @@ +// Bug: we were removing the p = q assignment in dce, and then reinserting +// it *after* the try/catch in out-of-ssa. Oops. + +// testcase reduced from libjava/interpret.cc. + +// { dg-do run } + +extern "C" int printf (const char *, ...); + +bool b; + +int main() +{ + __label__ one, two, done; + void *labs[] = { &&one, &&two, &&done }; + const void **q = (const void **)labs; + const void **p = q; + + try + { + one: + printf ("one!\n"); + if (b) + throw 42; + goto **p++; + + two: + printf ("two!\n"); + goto **p++; + + done: + printf ("done!\n"); + } + catch (int) + { + printf ("caught!\n"); + } +} |