aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.h
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2020-03-05 14:01:30 -0700
committerJeff Law <law@redhat.com>2020-03-05 14:01:30 -0700
commit55ace4d14637866466498ed43e02d6f95af98f10 (patch)
tree0bcdec4218fa6088b63ee2eb78903424aeb38f58 /gcc/gimple.h
parent3a0e583bf17240e55fee7b490e13753cca52bfe1 (diff)
downloadgcc-55ace4d14637866466498ed43e02d6f95af98f10.zip
gcc-55ace4d14637866466498ed43e02d6f95af98f10.tar.gz
gcc-55ace4d14637866466498ed43e02d6f95af98f10.tar.bz2
Fix location maybe_diag_overlap passes to diagnostics so that diagnostic pragmas work better.
PR tree-optimization/91890 * gimple-ssa-warn-restrict.c (maybe_diag_overlap): Remove LOC argument. Use gimple_or_expr_nonartificial_location. (check_bounds_overlap): Drop LOC argument to maybe_diag_access_bounds. Use gimple_or_expr_nonartificial_location. * gimple.c (gimple_or_expr_nonartificial_location): New function. * gimple.h (gimple_or_expr_nonartificial_location): Declare it. * tree-ssa-strlen.c (maybe_warn_overflow): Use gimple_or_expr_nonartificial_location. (maybe_diag_stxncpy_trunc, handle_builtin_stxncpy_strncat): Likewise. (maybe_warn_pointless_strcmp): Likewise. * gcc.dg/pragma-diag-8.c: New test.
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r--gcc/gimple.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 192f19a..0420d6d 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1633,6 +1633,8 @@ extern void gimple_seq_discard (gimple_seq);
extern void maybe_remove_unused_call_args (struct function *, gimple *);
extern bool gimple_inexpensive_call_p (gcall *);
extern bool stmt_can_terminate_bb_p (gimple *);
+extern location_t gimple_or_expr_nonartificial_location (gimple *, tree);
+
/* Formal (expression) temporary table handling: multiple occurrences of
the same scalar expression are evaluated into the same temporary. */