From 8a45b051bf874c645b2b0316ea3b542be4b594db Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Wed, 1 Aug 2018 23:39:35 +0000 Subject: 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 --- gcc/gimple-fold.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gcc/gimple-fold.c') diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index c3fa570..506a296 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -1657,7 +1657,6 @@ gimple_fold_builtin_strncpy (gimple_stmt_iterator *gsi, if (!nonstring) { tree fndecl = gimple_call_fndecl (stmt); - gcall *call = as_a (stmt); /* Warn about the lack of nul termination: the result is not a (nul-terminated) string. */ @@ -1666,11 +1665,11 @@ gimple_fold_builtin_strncpy (gimple_stmt_iterator *gsi, warning_at (loc, OPT_Wstringop_truncation, "%G%qD destination unchanged after copying no bytes " "from a string of length %E", - call, fndecl, slen); + stmt, fndecl, slen); else warning_at (loc, OPT_Wstringop_truncation, "%G%qD destination unchanged after copying no bytes", - call, fndecl); + stmt, fndecl); } replace_call_with_value (gsi, dest); @@ -1991,7 +1990,7 @@ gimple_fold_builtin_strcat_chk (gimple_stmt_iterator *gsi) static bool gimple_fold_builtin_strncat (gimple_stmt_iterator *gsi) { - gcall *stmt = as_a (gsi_stmt (*gsi)); + gimple *stmt = gsi_stmt (*gsi); tree dst = gimple_call_arg (stmt, 0); tree src = gimple_call_arg (stmt, 1); tree len = gimple_call_arg (stmt, 2); -- cgit v1.1