[PATCH] optinfo-emit-json.cc: don't call get_fnname_from_decl (PR middle-end/89725)

Jakub Jelinek jakub@redhat.com
Thu Mar 28 14:15:00 GMT 2019


On Thu, Mar 28, 2019 at 11:02:52AM -0400, David Malcolm wrote:
> optrecord_json_writer::optinfo_to_json can in theory be called from any
> optimization pass, but currently uses get_fnname_from_decl, which
> is RTL-specific, which can lead to an ICE (PR middle-end/89725).

The ICE is a separate problem.  The problem with DECL_RTL early is
that it is undesirable to create RTL for decls during gimple passes,
we then need to make sure to clear it when versioning the function etc.
> 
> In that PR, Jakub suggested using either DECL_ASSEMBLER_NAME or the
> "printable name" (via current_function_name).
> 
> This patch makes it use DECL_ASSEMBLER_NAME.
> 
> Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
> 
> OK for trunk?
> 
> gcc/ChangeLog:
> 	PR middle-end/89725
> 	* optinfo-emit-json.cc (optrecord_json_writer::optinfo_to_json):
> 	Use DECL_ASSEMBLER_NAME rather than get_fnname_from_decl.

Ok, thanks.

	Jakub



More information about the Gcc-patches mailing list