PR middle-end/98664 - inconsistent -Wfree-nonheap-object for inlined calls to system...
authorMartin Sebor <msebor@redhat.com>
Tue, 19 Jan 2021 22:10:30 +0000 (15:10 -0700)
committerMartin Sebor <msebor@redhat.com>
Tue, 19 Jan 2021 22:10:30 +0000 (15:10 -0700)
commit9693e255ee2536c6823640eba5d0163c2b401161
tree5f5735deb16a463d71fd69e8fcffe5b131aec478
parent29853c653245c37ed31b6abcc9799b534372e938
PR middle-end/98664 - inconsistent -Wfree-nonheap-object for inlined calls to system headers

gcc/ChangeLog:

PR middle-end/98664
* tree-ssa-live.c (remove_unused_scope_block_p): Keep scopes for
all functions, even if they're not declared artificial or inline.
* tree.c (tree_inlined_location): Use macro expansion location
only if scope traversal fails to expose one.

gcc/testsuite/ChangeLog:

PR middle-end/98664
* gcc.dg/Wvla-larger-than-4.c: Adjust expected output.
* gcc.dg/plugin/diagnostic-test-inlining-3.c: Same.
* g++.dg/warn/Wfree-nonheap-object-5.C: New test.
* gcc.dg/Wfree-nonheap-object-4.c: New test.
gcc/testsuite/g++.dg/warn/Wfree-nonheap-object-5.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wfree-nonheap-object-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wvla-larger-than-4.c
gcc/testsuite/gcc.dg/plugin/diagnostic-test-inlining-3.c
gcc/tree-ssa-live.c
gcc/tree.c