aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfgcleanup.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-06-11 14:29:53 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-06-11 12:29:53 +0000
commit7ea6b6cf97363a0f4dfb1a72a7cda31c59350bbc (patch)
treeb9d5e6003412755a9b91c08dbafc60f251457051 /gcc/tree-cfgcleanup.c
parent2ee3cb3591bfa67a216efe877ddcfca65851bbc8 (diff)
downloadgcc-7ea6b6cf97363a0f4dfb1a72a7cda31c59350bbc.zip
gcc-7ea6b6cf97363a0f4dfb1a72a7cda31c59350bbc.tar.gz
gcc-7ea6b6cf97363a0f4dfb1a72a7cda31c59350bbc.tar.bz2
invoke.texi (Wsuggest-attribute): Document.
* doc/invoke.texi (Wsuggest-attribute): Document. (Wmissing-noreturn): Remove. * ipa-pure-const.c (warn_function_noreturn): New function. * opts.c (decode_options): Set warn_suggest_attribute_noreturn on warn_missing_noreturn. * common.opt (Wsuggest-attribute=noreturn): New. * tree-flow.h (warn_function_noreturn): Declare. * tree-cfg.c (execute_warn_function_noreturn): Use warn_function_noreturn. (gate_warn_function_noreturn): New. (pass_warn_function_noreturn): Update. From-SVN: r160606
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r--gcc/tree-cfgcleanup.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index fc2141f..8dec8c7 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -568,9 +568,23 @@ fixup_noreturn_call (gimple stmt)
imm_use_iterator iter;
gimple use_stmt;
+ /* All statements using the OP are unreachable or PHI
+ statements where the edge correspoing to OP use is unreachable.
+ We need to remove all normal statements so fixup_cfg will not
+ try to update them and keep all PHIs but remove use of the SSA
+ name or verifier will complain. */
FOR_EACH_IMM_USE_STMT (use_stmt, iter, op)
- FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
- SET_USE (use_p, error_mark_node);
+ {
+ if (gimple_code (use_stmt) == GIMPLE_PHI)
+ FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
+ SET_USE (use_p, error_mark_node);
+ else
+ {
+ gimple_stmt_iterator gsi = gsi_for_stmt (use_stmt);
+ gsi_remove (&gsi, true);
+ }
+ }
+ release_ssa_name (op);
}
update_stmt (stmt);
changed = true;