This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Generate a label for the split cold function while using -freorder-blocks-and-partition


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]