aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-03-08 11:46:39 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-03-08 11:46:39 +0100
commit1db01ff96aa5ce5c4ad78313d342cf70f923b40c (patch)
treefae09df731b30ee508d5a37f95a71ca30d15912d /gcc/tree-cfg.c
parent94ec37a909697bbf29db73278c77621ccdf60693 (diff)
downloadgcc-1db01ff96aa5ce5c4ad78313d342cf70f923b40c.zip
gcc-1db01ff96aa5ce5c4ad78313d342cf70f923b40c.tar.gz
gcc-1db01ff96aa5ce5c4ad78313d342cf70f923b40c.tar.bz2
re PR tree-optimization/89550 (Spurious array-bounds warning when using __PRETTY_FUNCTION__ as a string_view)
PR tree-optimization/89550 * builtins.c (c_strlen): Only set TREE_NO_WARNING if warning_at returned true. Formatting fixes. (expand_builtin_strnlen): Formatting fixes. * tree-vrp.c (vrp_prop::check_mem_ref): Only set TREE_NO_WARNING if warning_at returned true. * tree-cfg.c (pass_warn_function_return::execute): Likewise. c-family/ * c-common.c (c_common_truthvalue_conversion): Only set TREE_NO_WARNING if warning_at returned true. * c-warn.c (overflow_warning, warn_logical_operator): Likewise. c/ * c-decl.c (finish_function): Only set TREE_NO_WARNING if warning_at returned true. (c_write_global_declarations_1): Only set TREE_NO_WARNING if pedwarn or warning returned true. cp/ * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if warning_at returned true. * decl2.c (c_parse_final_cleanups): Likewise. * typeck.c (convert_for_assignment): Likewise. * decl.c (finish_function): Likewise. From-SVN: r269485
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index f433efc..7196614 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -9329,9 +9329,9 @@ pass_warn_function_return::execute (function *fun)
location = gimple_location (last);
if (LOCATION_LOCUS (location) == UNKNOWN_LOCATION)
location = fun->function_end_locus;
- warning_at (location, OPT_Wreturn_type,
- "control reaches end of non-void function");
- TREE_NO_WARNING (fun->decl) = 1;
+ if (warning_at (location, OPT_Wreturn_type,
+ "control reaches end of non-void function"))
+ TREE_NO_WARNING (fun->decl) = 1;
break;
}
}
@@ -9361,9 +9361,9 @@ pass_warn_function_return::execute (function *fun)
location = gimple_location (prev);
if (LOCATION_LOCUS (location) == UNKNOWN_LOCATION)
location = fun->function_end_locus;
- warning_at (location, OPT_Wreturn_type,
- "control reaches end of non-void function");
- TREE_NO_WARNING (fun->decl) = 1;
+ if (warning_at (location, OPT_Wreturn_type,
+ "control reaches end of non-void function"))
+ TREE_NO_WARNING (fun->decl) = 1;
break;
}
}