aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-pretty-print.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2019-08-30 17:49:17 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2019-08-30 11:49:17 -0600
commit648af1684557e24e54a67b95b57fae2646cc2b56 (patch)
tree233e3d85c85e847a57c7720dcdc18a04a2f5d079 /gcc/gimple-pretty-print.c
parent5d69df7e9292522d00100b79f84a982359ed8142 (diff)
downloadgcc-648af1684557e24e54a67b95b57fae2646cc2b56.zip
gcc-648af1684557e24e54a67b95b57fae2646cc2b56.tar.gz
gcc-648af1684557e24e54a67b95b57fae2646cc2b56.tar.bz2
PR middle-end/91599 - GCC does not say where warning is happening
gcc/ChangeLog: PR middle-end/91599 * tree-ssa-strlen.c (handle_store): Use a fallback location if the statement doesn't have one. * gimple-pretty-print.c (percent_G_format): Same. gcc/testsuite/ChangeLog: PR middle-end/91599 * gcc.dg/Wstringop-overflow-16.c: New test. From-SVN: r275211
Diffstat (limited to 'gcc/gimple-pretty-print.c')
-rw-r--r--gcc/gimple-pretty-print.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index ce339ee..2d5ece0 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -3034,8 +3034,12 @@ percent_G_format (text_info *text)
{
gimple *stmt = va_arg (*text->args_ptr, gimple*);
+ /* Fall back on the rich location if the statement doesn't have one. */
+ location_t loc = gimple_location (stmt);
+ if (loc == UNKNOWN_LOCATION)
+ loc = text->m_richloc->get_loc ();
tree block = gimple_block (stmt);
- percent_K_format (text, gimple_location (stmt), block);
+ percent_K_format (text, loc, block);
}
#if __GNUC__ >= 10