diff options
author | Martin Sebor <msebor@redhat.com> | 2018-06-12 18:05:13 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2018-06-12 12:05:13 -0600 |
commit | e3329a782fc0e51b9a4ddfc6938a484ec4b03084 (patch) | |
tree | 54f2c40c75f1eaadb4e09b9210721c95bda1b3a4 /gcc/gimple.h | |
parent | 47feeb36526b106053ad8d4fc7a64c23ce16f5de (diff) | |
download | gcc-e3329a782fc0e51b9a4ddfc6938a484ec4b03084.zip gcc-e3329a782fc0e51b9a4ddfc6938a484ec4b03084.tar.gz gcc-e3329a782fc0e51b9a4ddfc6938a484ec4b03084.tar.bz2 |
PR tree-optimization/85259 - Missing -Wstringop-overflow= since r256683
gcc/ChangeLog:
PR tree-optimization/85259
* builtins.c (compute_objsize): Handle constant offsets.
* gimple-ssa-warn-restrict.c (maybe_diag_offset_bounds): Return
true iff a warning has been issued.
* gimple.h (gimple_nonartificial_location): New function.
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Call
gimple_nonartificial_location and handle -Wno-system-headers.
(handle_builtin_stxncpy): Same.
gcc/testsuite/ChangeLog:
PR tree-optimization/85259
* gcc.dg/Wstringop-overflow-5.c: New test.
* gcc.dg/Wstringop-overflow-6.c: New test.
From-SVN: r261518
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r-- | gcc/gimple.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h index 00a9f20..ab095f6 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -1796,6 +1796,20 @@ gimple_has_location (const gimple *g) } +/* Return non-artificial location information for statement G. */ + +static inline location_t +gimple_nonartificial_location (const gimple *g) +{ + location_t *ploc = NULL; + + if (tree block = gimple_block (g)) + ploc = block_nonartificial_location (block); + + return ploc ? *ploc : gimple_location (g); +} + + /* Return the file name of the location of STMT. */ static inline const char * |