This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Generate a label for the split cold function while using -freorder-blocks-and-partition
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Teresa Johnson <tejohnson at google dot com>
- Cc: Sriraman Tallam <tmsriram at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>, Cary Coutant <ccoutant at google dot com>
- Date: Fri, 8 Nov 2013 17:22:21 +0100
- Subject: Re: [PATCH] Generate a label for the split cold function while using -freorder-blocks-and-partition
- Authentication-results: sourceware.org; auth=none
- References: <CAAs8HmxQidaPqi3fFAjtdrK_d2R1d6uwYD=tJqJD8KYLV1yADQ at mail dot gmail dot com> <CABu31nMZgsnRJK3xLmRevxejXOG6FJLDxKzL7QXHacVHbTVMsw at mail dot gmail dot com> <CAAe5K+Vkb0PLu0=x5EJwz-yFKD=rAyaOHkK8-hoxaQgY5ojpCQ at mail dot gmail dot com>
On Fri, Nov 8, 2013 at 4:45 PM, Teresa Johnson wrote:
> For example, from mcf with -freorder-blocks-and-partition:
>
> main:
> .LFB40:
> .cfi_startproc
> ...
> jne .L27 <---- jump to main's text.unlikely
> ...
> .cfi_endproc
> .section .text.unlikely
> .cfi_startproc
> .L27: <--- start of main's text.unlikely
> ...
>
> $ objdump -d mcf
>
> 0000000000400aa0 <main>:
> ...
> 400b1a: 0f 85 1b fb ff ff jne 40063b
> <replace_weaker_arc+0x17b> <---- jump to main's text.unlikely
>
> 00000000004004c0 <replace_weaker_arc>:
> ...
> 40063b: bf 06 8a 49 00 mov $0x498a06,%edi <---
> start of main's text.unlikely
> ...
> 40065e: e9 0d 05 00 00 jmpq 400b70 <main+0xd0>
> <--- jump back to main's hot text
>
>
> Note that objdump thinks we are jumping to/from another function. If
> we end up executing the cold section (e.g. due to non-representative
> profiles), profiling tools and gdb are going to think we are executing
> replace_weaker_arc.
Isn't this something that should be expressed in DWARF with
DW_AT_ranges? See DWARF4, section 2.17,
Does GCC generate such ranges?
Ciao!
Steven