https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102061

--- Comment #6 from Peter Damianov <peter0x44 at disroot dot org> ---
I confirmed this is the case. Compiling the example from the testcase
independent-cloneids-1.c confirms that lhd_decl_printable_name is also used for
-fdump-rtl-final, my patch results in:
;; Function bar (bar.constprop.0, funcdef_no=3, decl_uid=2796, cgraph_uid=5,
symbol_order=4)
When previously it was:
;; Function bar.constprop (bar.constprop.0, funcdef_no=3, decl_uid=2002,
cgraph_uid=5, symbol_order=4)

I assume it is desired to include cloned names in the RTL dumps, so following
the DECL_ORIGIN in lhd_decl_printable_name isn't okay.

Maybe having a separate "lhd_decl_user_readable_name" would be necessary to
avoid this. Or potentially doing the "following DECL_ORIGIN links" in
lhd_print_error_function, or something more language specific.

There might be some other call sites that produce user facing diagnostics which
would need this sort of adjustment too, perhaps in the analyzer, but I'm not
qualified to tell.

Reply via email to