Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-March/541521.html
On 3/4/20 2:06 PM, Martin Sebor wrote:
A 2017 change that propagated call location to GIMPLE statements
had the unexpected (though not incorrect) effect of setting
the location on calls to __builtin_alloca. When such calls are
the result of the expansion of the alloca macro defined in
a system header like <alloca.h>, the change prevents -Walloca and
-Walloca-larger-than
warnings from being issued unless -Wsystem-headers is also used,
effectively defeating the point of the first two warnings in most
code.
The attached patch changes -Walloca to use the location of the point
of the macro expansion rather than that of its definition, restoring
the intended behavior.
In addition, to make the warnings (mainly -Wvla) in inlined code
easier to debug, the patch also arranges for the warnings to include
their inlining context.
Tested on x86_64-linux.
Martin