This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: improve -fverbose-asm option
2009/3/17 Ian Lance Taylor <iant@google.com>:
> The local labels used for blocks are normally discarded by the assembler
> and thus are never seen by tools like oprofile. ?Using named symbols for
> basic blocks seems like a reasonable option if it will indeed give
> better information from oprofile, but it should be an option separate
> from -fverbose-asm. ?The labels in RTL are CODE_LABEL insns, so you
> would want to change the way that they are emitted in final_scan_insn.
> The fact that there can be several CODE_LABELs in sequence doesn't seem
> to matter too much, since only one will be picked up by profiling tools.
> To be clear, I would want to see that you really do get better results
> from profiling tools before accepting such a patch.
I use -Wa,-L to prevent the assembler to discard the local labels.
I hope this will be useful. We can provide an option, say
-flong-internal-label, which just change the output of local labels
from
prefix + labelno
to
prefix + func_name + labelno
The objective of this is to generate a unique label name, so that the
oprofile samples will not fall into the different label areas with the
same name.
But I find It's difficult to change the internal label composition.
The target macros/hooks related to the label output all consider that
a internal label is composed by "prefix + labelno". Many places need
to be changed.
So I try to do this by redefine ASM_GENERATE_INTERNAL_LABEL and
TARGET_ASM_INTERNAL_LABEL in the back-end. But there's also a problem
which is that the user need to consider the length of the function
name and length of the label string buff.
Best regards,
Eric Fisher
Mar 17, 2009