Mercurial > hg > CbC > CbC_gcc
diff gcc/gimple-iterator.c @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | b7f97abdc517 |
line wrap: on
line diff
--- a/gcc/gimple-iterator.c Sun Feb 07 18:28:00 2010 +0900 +++ b/gcc/gimple-iterator.c Fri Feb 12 23:39:51 2010 +0900 @@ -45,9 +45,9 @@ update_modified_stmts (gimple_seq seq) { gimple_stmt_iterator gsi; - + if (!ssa_operands_active ()) - return; + return; for (gsi = gsi_start (seq); !gsi_end_p (gsi); gsi_next (&gsi)) update_stmt_if_modified (gsi_stmt (gsi)); } @@ -60,7 +60,7 @@ update_bb_for_stmts (gimple_seq_node first, basic_block bb) { gimple_seq_node n; - + for (n = first; n; n = n->next) gimple_set_bb (n->stmt, bb); } @@ -358,31 +358,27 @@ /* Replace the statement pointed-to by GSI to STMT. If UPDATE_EH_INFO is true, the exception handling information of the original - statement is moved to the new statement. */ + statement is moved to the new statement. Assignments must only be + replaced with assignments to the same LHS. */ void gsi_replace (gimple_stmt_iterator *gsi, gimple stmt, bool update_eh_info) { - int eh_region; gimple orig_stmt = gsi_stmt (*gsi); if (stmt == orig_stmt) return; + gcc_assert (!gimple_has_lhs (orig_stmt) + || gimple_get_lhs (orig_stmt) == gimple_get_lhs (stmt)); + gimple_set_location (stmt, gimple_location (orig_stmt)); gimple_set_bb (stmt, gsi_bb (*gsi)); /* Preserve EH region information from the original statement, if requested by the caller. */ if (update_eh_info) - { - eh_region = lookup_stmt_eh_region (orig_stmt); - if (eh_region >= 0) - { - remove_stmt_from_eh_region (orig_stmt); - add_stmt_to_eh_region (stmt, eh_region); - } - } + maybe_clean_or_replace_eh_stmt (orig_stmt, stmt); gimple_duplicate_stmt_histograms (cfun, stmt, cfun, orig_stmt); gimple_remove_stmt_histograms (cfun, orig_stmt); @@ -478,6 +474,8 @@ gimple_seq_node cur, next, prev; gimple stmt = gsi_stmt (*i); + insert_debug_temps_for_defs (i); + /* Free all the data flow information for STMT. */ gimple_set_bb (stmt, NULL); delink_stmt_imm_use (stmt); @@ -485,7 +483,7 @@ if (remove_permanently) { - remove_stmt_from_eh_region (stmt); + remove_stmt_from_eh_lp (stmt); gimple_remove_stmt_histograms (cfun, stmt); } @@ -604,7 +602,7 @@ In all cases, the returned *GSI points to the correct location. The return value is true if insertion should be done after the location, - or false if it should be done before the location. If new basic block + or false if it should be done before the location. If a new basic block has to be created, it is stored in *NEW_BB. */ static bool @@ -623,9 +621,9 @@ would have to examine the PHIs to prove that none of them used the value set by the statement we want to insert on E. That hardly seems worth the effort. */ -restart: + restart: if (single_pred_p (dest) - && ! phi_nodes (dest) + && gimple_seq_empty_p (phi_nodes (dest)) && dest != EXIT_BLOCK_PTR) { *gsi = gsi_start_bb (dest); @@ -667,10 +665,13 @@ if (!stmt_ends_bb_p (tmp)) return true; - if (gimple_code (tmp) == GIMPLE_RETURN) - { - gsi_prev (gsi); - return true; + switch (gimple_code (tmp)) + { + case GIMPLE_RETURN: + case GIMPLE_RESX: + return false; + default: + break; } }