https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91890
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jeff Law <l...@gcc.gnu.org>: https://gcc.gnu.org/g:55ace4d14637866466498ed43e02d6f95af98f10 commit r10-7049-g55ace4d14637866466498ed43e02d6f95af98f10 Author: Jeff Law <l...@redhat.com> Date: Thu Mar 5 14:01:30 2020 -0700 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.