This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19803] New: __builtin_expect doesnt modify branch prediction for power4 target
- From: "anton at samba dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Feb 2005 03:24:10 -0000
- Subject: [Bug tree-optimization/19803] New: __builtin_expect doesnt modify branch prediction for power4 target
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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