On 3/1/21 1:39 AM, Richard Biener wrote:
> The default diagnostic tree printer relies on dump_generic_node which
> for some reason manages to clobber the diagnostic pretty-printer state
> so we see garbled diagnostics like
>
> /home/rguenther/src/trunk/gcc/calls.c: In function 'expand_call':
> D.6750.coeffs[0]'/home/rguenther/src/trunk/gcc/dojump.c:118:28: warning: may
> be used uninitialized in this function [-Wmaybe-uninitialized]
>
> when the diagnostic is emitted by the LTO fronted. The following
> approach using a temporary pretty-printer for the dump_generic_node
> call fixes this for some unknown reason and we issue
>
> /home/rguenther/src/trunk/gcc/calls.c: In function 'expand_call':
> /home/rguenther/src/trunk/gcc/dojump.c:118:28: warning: 'MEM[(struct poly_int
> *)&save].D.6750.coeffs[0]' may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>
> [LTO] Bootstrapped and tested on x86_64-unknown-linux-gnu, OK for trunk?
>
> Thanks,
> Richard.
>
> 2021-02-26 Richard Biener <rguent...@suse.de>
>
> PR middle-end/97855
> * tree-diagnostic.c (default_tree_printer): Use a temporary
> pretty-printer when formatting a tree via dump_generic_node.
It'd be good to know why this helps, but I trust your judgment that this
is an improvement.
OK
jeff