public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/19803] New: __builtin_expect doesnt modify branch prediction for power4 target
@ 2005-02-07 15:28 anton at samba dot org
  2005-02-07 17:21 ` [Bug tree-optimization/19803] " amodra at bigpond dot net dot au
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: anton at samba dot org @ 2005-02-07 15:28 UTC (permalink / raw)
  To: gcc-bugs

gcc version 4.0.0 20050203 (experimental)

The following code snippet shows how branch prediction isnt used even when
specifying builtin_expect. flags used: -O2 -mcpu=power4

#if 1
#define likely(x)       __builtin_expect(!!(x), 1)
#else
#define likely(x) x
#endif

int i;

void foo(void)
{
        while (likely(i--)) {
                bar();
        }

}

...

        b .L2
        .p2align 4,,15
.L3:
        bl bar
        nop
.L2:
        lwz 9,0(31)
        addi 9,9,-1
        extsw 9,9
        cmpwi 7,9,-1
        stw 9,0(31)
        bne 7,.L3

-- 
           Summary: __builtin_expect doesnt modify branch prediction for
                    power4 target
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anton at samba dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc64-unknown-linux-gnu


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


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

end of thread, other threads:[~2005-02-07 21:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-07 15:28 [Bug tree-optimization/19803] New: __builtin_expect doesnt modify branch prediction for power4 target anton at samba dot org
2005-02-07 17:21 ` [Bug tree-optimization/19803] " amodra at bigpond dot net dot au
2005-02-07 17:21 ` [Bug target/19803] __builtin_expect does not modify branch prediction for power4/5 pinskia at gcc dot gnu dot org
2005-02-07 17:25 ` amodra at bigpond dot net dot au
2005-02-08  9:18 ` cvs-commit at gcc dot gnu dot org
2005-02-08  9:19 ` cvs-commit at gcc dot gnu dot org
2005-02-08  9:25 ` amodra at bigpond dot net dot au

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).