data->last_goto = NULL;
break;
+ case OMP_PARALLEL:
+ /* Make sure the outermost BIND_EXPR in OMP_BODY isn't removed
+ as useless. */
+ remove_useless_stmts_1 (&BIND_EXPR_BODY (OMP_BODY (*tp)), data);
+ data->last_goto = NULL;
+ break;
+
+ case OMP_SECTIONS:
+ case OMP_SINGLE:
+ case OMP_SECTION:
+ case OMP_MASTER :
+ case OMP_ORDERED:
+ case OMP_CRITICAL:
+ remove_useless_stmts_1 (&OMP_BODY (*tp), data);
+ data->last_goto = NULL;
+ break;
+
+ case OMP_FOR:
+ remove_useless_stmts_1 (&OMP_FOR_BODY (*tp), data);
+ data->last_goto = NULL;
+ if (OMP_FOR_PRE_BODY (*tp))
+ {
+ remove_useless_stmts_1 (&OMP_FOR_PRE_BODY (*tp), data);
+ data->last_goto = NULL;
+ }
+ break;
+
default:
data->last_goto = NULL;
break;
case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR:
+ gcc_unreachable ();
+
case TRUTH_AND_EXPR:
case TRUTH_OR_EXPR:
case TRUTH_XOR_EXPR:
if (addr)
{
debug_generic_stmt (addr);
+ if (addr != stmt)
+ {
+ inform ("in statement");
+ debug_generic_stmt (stmt);
+ }
return true;
}
arg = DECL_ARGUMENTS (fn);
while (arg)
{
+ print_generic_expr (file, TREE_TYPE (arg), dump_flags);
+ fprintf (file, " ");
print_generic_expr (file, arg, dump_flags);
if (TREE_CHAIN (arg))
fprintf (file, ", ");
static bool
need_fake_edge_p (tree t)
{
- tree call;
+ tree call, fndecl = NULL_TREE;
+ int call_flags;
/* NORETURN and LONGJMP calls already have an edge to exit.
CONST and PURE calls do not need one.
the counter incrementation code from -fprofile-arcs
leads to different results from -fbranch-probabilities. */
call = get_call_expr_in (t);
- if (call
- && !(call_expr_flags (call) & ECF_NORETURN))
+ if (call)
+ {
+ fndecl = get_callee_fndecl (call);
+ call_flags = call_expr_flags (call);
+ }
+
+ if (call && fndecl && DECL_BUILT_IN (fndecl)
+ && (call_flags & ECF_NOTHROW)
+ && !(call_flags & ECF_NORETURN)
+ && !(call_flags & ECF_RETURNS_TWICE))
+ return false;
+
+ if (call && !(call_flags & ECF_NORETURN))
return true;
if (TREE_CODE (t) == ASM_EXPR
if (warn_missing_noreturn
&& !TREE_THIS_VOLATILE (cfun->decl)
&& EDGE_COUNT (EXIT_BLOCK_PTR->preds) == 0
- && !lang_hooks.function.missing_noreturn_ok_p (cfun->decl))
+ && !lang_hooks.missing_noreturn_ok_p (cfun->decl))
warning (OPT_Wmissing_noreturn, "%Jfunction might be possible candidate "
"for attribute %<noreturn%>",
cfun->decl);