diff options
author | Martin Sebor <msebor@redhat.com> | 2018-08-01 23:39:35 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2018-08-01 17:39:35 -0600 |
commit | 8a45b051bf874c645b2b0316ea3b542be4b594db (patch) | |
tree | 26db1a736bc6394312b1820c7cdecd89d3a75fdf /gcc/c-family/c-format.c | |
parent | ca9a1314ec5f2b58921e24abdcebae1482c0e2c6 (diff) | |
download | gcc-8a45b051bf874c645b2b0316ea3b542be4b594db.zip gcc-8a45b051bf874c645b2b0316ea3b542be4b594db.tar.gz gcc-8a45b051bf874c645b2b0316ea3b542be4b594db.tar.bz2 |
PR tree-optimization/86650 - -Warray-bounds missing inlining context
gcc/c/ChangeLog:
PR tree-optimization/86650
* c-objc-common.c (c_tree_printer): Move usage of EXPR_LOCATION (t)
and TREE_BLOCK (t) from within percent_K_format to this callsite.
gcc/c-family/ChangeLog:
PR tree-optimization/86650
* c-family/c-format.c (gcc_tdiag_char_table): Update comment for "%G".
(gcc_cdiag_char_table, gcc_cxxdiag_char_table): Same.
(init_dynamic_diag_info): Update from "gcall *" to "gimple *".
* c-format.h (T89_G): Update to be "gimple *" rather than
"gcall *".
(local_gcall_ptr_node): Rename...
(local_gimple_ptr_node): ...to this.
gcc/cp/ChangeLog:
PR tree-optimization/86650
* error.c (cp_printer): Move usage of EXPR_LOCATION (t) and
TREE_BLOCK (t) from within percent_K_format to this callsite.
gcc/ChangeLog:
PR tree-optimization/86650
* gimple-pretty-print.c (percent_G_format): Accept a "gimple *"
rather than a "gcall *". Directly pass the data of interest
to percent_K_format, rather than building a temporary CALL_EXPR
to hold it.
* gimple-fold.c (gimple_fold_builtin_strncpy): Adjust.
(gimple_fold_builtin_strncat): Adjust.
* gimple-ssa-warn-restrict.h (check_bounds_or_overlap): Replace
gcall* argument with gimple*.
* gimple-ssa-warn-restrict.c (check_call): Same.
(wrestrict_dom_walker::before_dom_children): Same.
(builtin_access::builtin_access): Same.
(check_bounds_or_overlap): Same
(maybe_diag_overlap): Same.
(maybe_diag_offset_bounds): Same.
* tree-diagnostic.c (default_tree_printer): Move usage of
EXPR_LOCATION (t) and TREE_BLOCK (t) from within percent_K_format
to this callsite.
* tree-pretty-print.c (percent_K_format): Add argument.
* tree-pretty-print.h: Add argument.
* tree-ssa-ccp.c (pass_post_ipa_warn::execute): Adjust.
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Adjust.
(maybe_diag_stxncpy_trunc): Same.
(handle_builtin_stxncpy): Same.
(handle_builtin_strcat): Same.
gcc/testsuite/ChangeLog:
PR tree-optimization/86650
* gcc.dg/format/gcc_diag-10.c: Adjust.
From-SVN: r263239
Diffstat (limited to 'gcc/c-family/c-format.c')
-rw-r--r-- | gcc/c-family/c-format.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index 82841e4..dc0e756 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -56,7 +56,7 @@ struct function_format_info /* Initialized in init_dynamic_diag_info. */ static GTY(()) tree local_tree_type_node; -static GTY(()) tree local_gcall_ptr_node; +static GTY(()) tree local_gimple_ptr_node; static GTY(()) tree locus; static bool decode_format_attr (tree, function_format_info *, int); @@ -719,7 +719,7 @@ static const format_char_info gcc_tdiag_char_table[] = { "E", 1, STD_C89, { T89_T, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+", "", NULL }, { "K", 1, STD_C89, { T89_T, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "\"", NULL }, - /* G requires a "gcall*" argument at runtime. */ + /* G requires a "gimple*" argument at runtime. */ { "G", 1, STD_C89, { T89_G, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "\"", NULL }, { NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL } @@ -737,7 +737,7 @@ static const format_char_info gcc_cdiag_char_table[] = { "E", 1, STD_C89, { T89_T, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+", "", NULL }, { "K", 1, STD_C89, { T89_T, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "\"", NULL }, - /* G requires a "gcall*" argument at runtime. */ + /* G requires a "gimple*" argument at runtime. */ { "G", 1, STD_C89, { T89_G, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "\"", NULL }, { "v", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q#", "", NULL }, @@ -757,7 +757,7 @@ static const format_char_info gcc_cxxdiag_char_table[] = { "E", 1,STD_C89,{ T89_T, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+#", "", NULL }, { "K", 1, STD_C89,{ T89_T, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "\"", NULL }, - /* G requires a "gcall*" argument at runtime. */ + /* G requires a "gimple*" argument at runtime. */ { "G", 1, STD_C89,{ T89_G, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "\"", NULL }, /* These accept either an 'int' or an 'enum tree_code' (which is handled as an 'int'.) */ @@ -3838,27 +3838,27 @@ init_dynamic_diag_info (void) local_tree_type_node = void_type_node; } - /* Similar to the above but for gcall*. */ - if (!local_gcall_ptr_node - || local_gcall_ptr_node == void_type_node) + /* Similar to the above but for gimple*. */ + if (!local_gimple_ptr_node + || local_gimple_ptr_node == void_type_node) { - if ((local_gcall_ptr_node = maybe_get_identifier ("gcall"))) + if ((local_gimple_ptr_node = maybe_get_identifier ("gimple"))) { - local_gcall_ptr_node - = identifier_global_value (local_gcall_ptr_node); - if (local_gcall_ptr_node) + local_gimple_ptr_node + = identifier_global_value (local_gimple_ptr_node); + if (local_gimple_ptr_node) { - if (TREE_CODE (local_gcall_ptr_node) != TYPE_DECL) + if (TREE_CODE (local_gimple_ptr_node) != TYPE_DECL) { - error ("%<gcall%> is not defined as a type"); - local_gcall_ptr_node = 0; + error ("%<gimple%> is not defined as a type"); + local_gimple_ptr_node = 0; } else - local_gcall_ptr_node = TREE_TYPE (local_gcall_ptr_node); + local_gimple_ptr_node = TREE_TYPE (local_gimple_ptr_node); } } else - local_gcall_ptr_node = void_type_node; + local_gimple_ptr_node = void_type_node; } static tree hwi; |