This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/28364] poor optimization choices when iterating over a std::string (probably not c++-specific)
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jul 2006 22:52:25 -0000
- Subject: [Bug tree-optimization/28364] poor optimization choices when iterating over a std::string (probably not c++-specific)
- References: <bug-28364-37@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from pinskia at gcc dot gnu dot org 2006-07-12 22:52 -------
For me on PPC-darwin, it generates pretty good code at just -O2 even though
there is a duplicated "header". The loop is pretty good at scheduling the code
too:
L9:
lbz r0,0(r3)
cmplwi cr7,r0,31
extsb r0,r0
cmpwi cr1,r0,127
cmpwi cr6,r0,92
ble- cr7,L4
beq- cr6,L4
beq- cr1,L4
L8:
addi r3,r3,1
bdnz L9
Though the branches throw off everything (though that is a different issue),
for the Cell really cror should be used (I think).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364