diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2025-07-10 16:56:21 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@ucw.cz> | 2025-07-10 16:57:13 +0200 |
commit | 50f3a6a437ad4f2438191b6d9aa9aed8575b9372 (patch) | |
tree | b13251e4bf52af651ea692944a3e468a8527708f /libgcc | |
parent | 5aa21765236730c1772c19454cbb71365b84d583 (diff) | |
download | gcc-50f3a6a437ad4f2438191b6d9aa9aed8575b9372.zip gcc-50f3a6a437ad4f2438191b6d9aa9aed8575b9372.tar.gz gcc-50f3a6a437ad4f2438191b6d9aa9aed8575b9372.tar.bz2 |
Fixes to auto-profile and Gimple matching.
This patch fixes several issues I noticed in gimple matching and -Wauto-profile
warning. One problem is that we mismatched symbols with user names, such as
"*strlen" instead of "strlen". I added raw_symbol_name to strip extra '*' which
is ok on ELF targets which are only targets we support with auto-profile, but
eventually we will want to add the user prefix. There is sorry about this.
Also I think dwarf2out is wrong:
static void
add_linkage_attr (dw_die_ref die, tree decl)
{
const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
/* Mimic what assemble_name_raw does with a leading '*'. */
if (name[0] == '*')
name = &name[1];
The patch also fixes locations of warning. I used location of problematic
statement as warning_at parmaeter but also included info about the containing
funtction. This makes warning_at to ignore the fist location that is fixed now.
I also fixed the ICE with -Wno-auto-profile disussed earlier.
Bootstrapped/regtested x86_64-linux. Autoprofiled bootstrap now fails for
weird reasons for me (it does not bild the training stage), so I will try to
debug this before comitting.
gcc/ChangeLog:
* auto-profile.cc: Include output.h.
(function_instance::set_call_location): Also sanity check
that location is known.
(raw_symbol_name): Two new static functions.
(dump_inline_stack): Use it.
(string_table::get_index_by_decl): Likewise.
(function_instance::get_cgraph_node): Likewise.
(function_instance::get_function_instance_by_decl): Fix typo
in warning; use raw names; fix lineno decoding.
(match_with_target): Add containing funciton parameter;
correctly output function and call location in warning.
(function_instance::lookup_count): Fix warning locations.
(function_instance::match): Fix warning locations; avoid
crash with mismatched callee; do not warn about broken callsites
twice.
(autofdo_source_profile::offline_external_functions): Use
raw_assembler_name.
(walk_block): Use raw_assembler_name.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-prof/afdo-inline.c: Add user symbol names.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions