From 865f704603c2db06e82aaf1036a9cd6dca0cf3d6 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 17 Aug 2016 16:24:53 +0200 Subject: [PATCH] gimple-fold.c (gimple_fold_call): Use gimple_call_noreturn_p instead of testing ECF_NORETURN bit in gimple_call_flags. * gimple-fold.c (gimple_fold_call): Use gimple_call_noreturn_p instead of testing ECF_NORETURN bit in gimple_call_flags. * tree-cfg.c (make_edges_bb, execute_fixup_cfg): Likewise. * predict.c (tree_bb_level_predictions): Likewise. * gimple-low.c (gimple_stmt_may_fallthru): Likewise. From-SVN: r239539 --- gcc/ChangeLog | 6 ++++++ gcc/gimple-fold.c | 2 +- gcc/gimple-low.c | 2 +- gcc/predict.c | 3 +-- gcc/tree-cfg.c | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9bb3824437b..8c27eae13d7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2016-08-17 Jakub Jelinek + * gimple-fold.c (gimple_fold_call): Use gimple_call_noreturn_p + instead of testing ECF_NORETURN bit in gimple_call_flags. + * tree-cfg.c (make_edges_bb, execute_fixup_cfg): Likewise. + * predict.c (tree_bb_level_predictions): Likewise. + * gimple-low.c (gimple_stmt_may_fallthru): Likewise. + PR middle-end/77259 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): If turning a call into __builtin_unreachable-like noreturn call, adjust diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 73c231445fb..fbbe52004aa 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -3184,7 +3184,7 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace) /* If changing the call to __cxa_pure_virtual or similar noreturn function, adjust gimple_call_fntype too. */ - if ((gimple_call_flags (stmt) & ECF_NORETURN) + if (gimple_call_noreturn_p (stmt) && VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fndecl))) && TYPE_ARG_TYPES (TREE_TYPE (fndecl)) && (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (fndecl))) diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index 9ea17af6637..5f3361acba8 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -610,7 +610,7 @@ gimple_stmt_may_fallthru (gimple *stmt) case GIMPLE_CALL: /* Functions that do not return do not fall through. */ - return (gimple_call_flags (stmt) & ECF_NORETURN) == 0; + return !gimple_call_noreturn_p (stmt); default: return true; diff --git a/gcc/predict.c b/gcc/predict.c index c1dbb96b8c5..035a0c2e7d6 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -2639,8 +2639,7 @@ tree_bb_level_predictions (void) if (is_gimple_call (stmt)) { - if ((gimple_call_flags (stmt) & ECF_NORETURN) - && has_return_edges) + if (gimple_call_noreturn_p (stmt) && has_return_edges) predict_paths_leading_to (bb, PRED_NORETURN, NOT_TAKEN); decl = gimple_call_fndecl (stmt); diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 4e55a83d38a..57c84108a5c 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -807,7 +807,7 @@ make_edges_bb (basic_block bb, struct omp_region **pcur_region, int *pomp_index) } /* Some calls are known not to return. */ else - fallthru = !(gimple_call_flags (last) & ECF_NORETURN); + fallthru = !gimple_call_noreturn_p (last); break; case GIMPLE_ASSIGN: @@ -9083,7 +9083,7 @@ execute_fixup_cfg (void) if (!stmt || (!is_ctrl_stmt (stmt) && (!is_gimple_call (stmt) - || (gimple_call_flags (stmt) & ECF_NORETURN) == 0))) + || !gimple_call_noreturn_p (stmt)))) { if (stmt && is_gimple_call (stmt)) gimple_call_set_ctrl_altering (stmt, false); -- 2.30.2