middle-end/97855 - avoid recursing into pp_printf
authorRichard Biener <rguenther@suse.de>
Thu, 4 Mar 2021 08:00:55 +0000 (09:00 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 4 Mar 2021 10:32:34 +0000 (11:32 +0100)
commitf232f782e6e4954370ac63ba6e40ad554c0cf942
tree8189e32cd959eaa31005852f42a7db6098309207
parent905ce0ca30cb33cddf024b0aebf4ba0b2c86fe77
middle-end/97855 - avoid recursing into pp_printf

When diagnostic messages use pretty-printer formats like %D or %E
the pp_printf invocation can end up in tree pretty-printers which
then have to avoid using pp_printf themselves since this function
is not re-entrant.

The following removes all pp_printf uses from tree-pretty-print.c
fixing the observed malformed diagnostics.  It also poisons the
identifier so new uses are less likely to creep in.

2021-03-04  Richard Biener  <rguenther@suse.de>

PR middle-end/97855
* tree-pretty-print.c: Poison pp_printf.
(dump_decl_name): Avoid use of pp_printf.
(dump_block_node): Likewise.
(dump_generic_node): Likewise.
gcc/tree-pretty-print.c