This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Gimplifying Java
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: Jeff Law <law at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 13 Jun 2003 18:10:24 -0400 (EDT)
- Subject: Re: [tree-ssa] Gimplifying Java
On 13 Jun 2003, Andrew MacLeod wrote:
> OK, removing stupidity from my patch results in this one. This appears
> to cause no new regfressions, but I havent bootstrapped yet. this one
> *should* be fine :-) Give it a try and see if your java problem goes
> away. It should peform the insert correctly now.
Hmm. It didn't seem to affect my test case :-(
> * tree-cfg.c (bsi_commit_first_edge_insert): Only consider non-abnormal
> edges when determining whether an edge needs to be split.
I don't know what went wrong yet, the logic there seems correct.
Oh well... call me crazy, but the following simple change seems to help.
Neither a TRY_CATCH_EXPR nor a CATCH_EXPR can have more than one
successor. And in the default case, why not insert at the end of the
source block? Somewhere it fails to realize the dest can have more than
one PRED, with or without your patch.
Reduces FAILs on libjava from 3 to 1. Full bootstrap pending.
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.105
diff -U7 -p -r1.1.4.105 tree-cfg.c
--- tree-cfg.c 12 Jun 2003 04:36:20 -0000 1.1.4.105
+++ tree-cfg.c 13 Jun 2003 22:00:01 -0000
@@ -1080,25 +1080,23 @@ make_ctrl_stmt_edges (basic_block bb)
/* FALL THROUGH */
case TRY_CATCH_EXPR:
{
basic_block target_bb = bb_for_stmt (TREE_OPERAND (last, 0));
if (target_bb)
make_edge (bb, target_bb, EDGE_FALLTHRU);
- make_edge (bb, successor_block (bb), EDGE_FALLTHRU);
break;
}
case CATCH_EXPR:
{
basic_block target_bb = bb_for_stmt (CATCH_BODY (last));
if (target_bb)
make_edge (bb, target_bb, EDGE_FALLTHRU);
- make_edge (bb, successor_block (bb), EDGE_FALLTHRU);
break;
}
case EH_FILTER_EXPR:
{
basic_block target_bb = bb_for_stmt (EH_FILTER_FAILURE (last));
@@ -3799,15 +3797,16 @@ find_insert_location (basic_block src, b
case SWITCH_EXPR:
ret = handle_switch_split (new_block, dest);
*location = EDGE_INSERT_LOCATION_AFTER;
break;
default:
- ret = dest->head_tree_p;
+ ret = src->end_tree_p;
+ *location = EDGE_INSERT_LOCATION_AFTER;
break;
}
}
else
ret = src->end_tree_p;
return tsi_start (ret);