public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/26493]  New: -freorder-blocks-and-partition is a dud
@ 2006-02-28  8:26 arjanv at redhat dot com
  2007-04-13 21:41 ` [Bug rtl-optimization/26493] -freorder-blocks-and-partition is a dud without generated profiling data steven at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: arjanv at redhat dot com @ 2006-02-28  8:26 UTC (permalink / raw)
  To: gcc-bugs

Gcc puts the section markers incorrect, resulting in a basically dummy effect

Take this simple example:
void simple_test(int X)
{
        if (__builtin_expect((X==3),0))
                call_slowpath_function();
        else
                call_fastpath_function();
}

this leads to the following assembly with 
gcc -O2 -freorder-blocks-and-parittions -s test.c

       .file   "test.c"
        .section        .text.unlikely,"ax",@progbits
.LCOLDB0:
        .text
.LHOTB0:
        .p2align 4,,15
.globl simple_test
        .type   simple_test, @function
simple_test:
.LFB2:
        cmpl    $3, %edi
        je      .L7
        xorl    %eax, %eax
        jmp     call_fastpath_function
.L7:
        xorl    %eax, %eax
        jmp     call_slowpath_function
.LFE2:
        .size   simple_test, .-simple_test
        .section        .text.unlikely
.LCOLDE0:
        .text
.LHOTE0:



as you can see, the .text.unlikely is put after the slowpath code, not when the
slowpath code starts.... which is less than useful.
(it happens for much bigger functions/slowpaths as well so it's not just due to
the small size of the unlikely part here)


-- 
           Summary: -freorder-blocks-and-partition is a dud
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: arjanv at redhat dot com
  GCC host triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26493


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-12-30 20:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-26493-4@http.gcc.gnu.org/bugzilla/>
2013-12-30 19:07 ` [Bug rtl-optimization/26493] -freorder-blocks-and-partition is a dud without generated profiling data pinskia at gcc dot gnu.org
2013-12-30 19:12 ` mkgnu at mkgnu dot net
2013-12-30 19:21 ` mkgnu at mkgnu dot net
2013-12-30 19:31 ` mkgnu at mkgnu dot net
2013-12-30 20:39 ` mkgnu at mkgnu dot net
2006-02-28  8:26 [Bug c/26493] New: -freorder-blocks-and-partition is a dud arjanv at redhat dot com
2007-04-13 21:41 ` [Bug rtl-optimization/26493] -freorder-blocks-and-partition is a dud without generated profiling data steven at gcc dot gnu dot org
2007-04-24 19:27 ` pinskia at gcc dot gnu dot org
2007-04-25  1:12 ` mkgnu at mkgnu dot net
2007-04-30 22:42 ` mkgnu at mkgnu dot net
2007-04-30 22:49 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).