+
+ FOR_EACH_BB (bb)
+ {
+ /* Remove dead statements. */
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
+ {
+ stmt = gsi_stmt (gsi);
+
+ stats.total++;
+
+ /* If GSI is not necessary then remove it. */
+ if (!gimple_plf (stmt, STMT_NECESSARY))
+ {
+ remove_dead_stmt (&gsi, bb);
+ something_changed = true;
+ }
+ else if (is_gimple_call (stmt))
+ {
+ call = gimple_call_fndecl (stmt);
+ if (call)
+ {
+ tree name;
+ gimple g;
+
+ /* When LHS of var = call (); is dead, simplify it into
+ call (); saving one operand. */
+ name = gimple_call_lhs (stmt);
+ if (name && TREE_CODE (name) == SSA_NAME
+ && !TEST_BIT (processed, SSA_NAME_VERSION (name)))
+ {
+ something_changed = true;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Deleting LHS of call: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ fprintf (dump_file, "\n");
+ }
+
+ push_stmt_changes (gsi_stmt_ptr (&gsi));
+ g = gimple_copy (stmt);
+ gimple_call_set_lhs (g, NULL_TREE);
+ gsi_replace (&gsi, g, false);
+ maybe_clean_or_replace_eh_stmt (stmt, g);
+ mark_symbols_for_renaming (g);
+ pop_stmt_changes (gsi_stmt_ptr (&gsi));
+ release_ssa_name (name);
+ }
+ notice_special_calls (stmt);
+ }
+ gsi_next (&gsi);
+ }
+ else
+ {
+ gsi_next (&gsi);
+ }
+ }
+ }
+
+ return something_changed;