diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-06 18:45:31 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-06 18:45:31 +0000 |
commit | e531b5f05ebd7967fc8b1a97219b0cb8fc091a8c (patch) | |
tree | 132c51a832ee578c60a08a99cb44c05490e8842a /gcc/gcse.c | |
parent | 68314777089c4e1604c9b7feb72cda66c9014506 (diff) | |
download | gcc-e531b5f05ebd7967fc8b1a97219b0cb8fc091a8c.tar.gz |
* gcse.c (compute_pre_data): Kill trapping expressions in
destination blocks of abnormal edges.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38068 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c index 25736dfa671..73f49f3ce88 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -4157,11 +4157,24 @@ free_pre_mem () static void compute_pre_data () { + sbitmap trapping_expr; int i; + unsigned int ui; compute_local_properties (transp, comp, antloc, 0); sbitmap_vector_zero (ae_kill, n_basic_blocks); + /* Collect expressions which might trap. */ + trapping_expr = sbitmap_alloc (n_exprs); + sbitmap_zero (trapping_expr); + for (ui = 0; ui < expr_hash_table_size; ui++) + { + struct expr *e; + for (e = expr_hash_table[ui]; e != NULL; e = e->next_same_hash) + if (may_trap_p (e->expr)) + SET_BIT (trapping_expr, e->bitmap_index); + } + /* Compute ae_kill for each basic block using: ~(TRANSP | COMP) @@ -4170,6 +4183,20 @@ compute_pre_data () for (i = 0; i < n_basic_blocks; i++) { + edge e; + + /* If the current block is the destination of an abnormal edge, we + kill all trapping expressions because we won't be able to properly + place the instruction on the edge. So make them neither + anticipatable nor transparent. This is fairly conservative. */ + for (e = BASIC_BLOCK (i)->pred; e ; e = e->pred_next) + if (e->flags & EDGE_ABNORMAL) + { + sbitmap_difference (antloc[i], antloc[i], trapping_expr); + sbitmap_difference (transp[i], transp[i], trapping_expr); + break; + } + sbitmap_a_or_b (ae_kill[i], transp[i], comp[i]); sbitmap_not (ae_kill[i], ae_kill[i]); } @@ -4180,6 +4207,7 @@ compute_pre_data () antloc = NULL; free (ae_kill); ae_kill = NULL; + free (trapping_expr); } /* PRE utilities */ |