[PATCH] middle-end/97855 - fix diagnostic with default pretty printer

Jeff Law jeffreyalaw@gmail.com
Tue Mar 2 16:52:50 GMT 2021



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  <rguenther@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



More information about the Gcc-patches mailing list