diff options
author | Martin Sebor <msebor@redhat.com> | 2021-09-02 09:20:09 -0600 |
---|---|---|
committer | Martin Sebor <msebor@redhat.com> | 2021-09-02 09:20:09 -0600 |
commit | 9695e1c23be5b5c55d572ced152897313ddb96ae (patch) | |
tree | fa5ec855dd296b487abc5e72732607076968f5e8 /gcc/tree-ssa-uninit.c | |
parent | 5960477a432c433392832a3765a96105e4f73a80 (diff) | |
download | gcc-9695e1c23be5b5c55d572ced152897313ddb96ae.zip gcc-9695e1c23be5b5c55d572ced152897313ddb96ae.tar.gz gcc-9695e1c23be5b5c55d572ced152897313ddb96ae.tar.bz2 |
Improve -Wuninitialized note location.
Related:
PR tree-optimization/17506 - warning about uninitialized variable points to wrong location
PR testsuite/37182 - Revision 139286 caused gcc.dg/pr17506.c and gcc.dg/uninit-15.c
gcc/ChangeLog:
PR tree-optimization/17506
PR testsuite/37182
* tree-ssa-uninit.c (warn_uninit): Remove conditional guarding note.
gcc/testsuite/ChangeLog:
PR tree-optimization/17506
PR testsuite/37182
* gcc.dg/diagnostic-tree-expr-ranges-2.c: Add expected output.
* gcc.dg/uninit-15-O0.c: Remove xfail.
* gcc.dg/uninit-15.c: Same.
Diffstat (limited to 'gcc/tree-ssa-uninit.c')
-rw-r--r-- | gcc/tree-ssa-uninit.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c index 394dbf4..cb6d114 100644 --- a/gcc/tree-ssa-uninit.c +++ b/gcc/tree-ssa-uninit.c @@ -206,14 +206,7 @@ warn_uninit (opt_code opt, tree t, tree var, const char *gmsgid, if (location == var_loc) return; - location_t cfun_loc = DECL_SOURCE_LOCATION (cfun->decl); - expanded_location xloc = expand_location (location); - expanded_location floc = expand_location (cfun_loc); - if (xloc.file != floc.file - || linemap_location_before_p (line_table, location, cfun_loc) - || linemap_location_before_p (line_table, cfun->function_end_locus, - location)) - inform (var_loc, "%qD was declared here", var); + inform (var_loc, "%qD was declared here", var); } struct check_defs_data |