This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/17343] [3.5 Regression] a dispatch table can be shortened for certain switch statements
- 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: 7 Sep 2004 08:54:12 -0000
- Subject: [Bug tree-optimization/17343] [3.5 Regression] a dispatch table can be shortened for certain switch statements
- References: <20040907084259.17343.kazu@cs.umass.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-07 08:54 -------
This is actually a regression from 3.4.0.
for PPC (for 3.4.0):
_foo:
cmpwi cr7,r3,15
beq- cr7,L4
cmpwi cr7,r3,16
beq- cr7,L5
cmpwi cr7,r3,14
bne- cr7,L2
b _foo1
L4:
b _foo2
L5:
b _foo3
L2:
b _foo0
For 3.5.0:
_foo:
addi r0,r3,-10
cmplwi cr7,r0,6
bgt- cr7,L2
lis r2,ha16(L6)
slwi r0,r0,2
la r2,lo16(L6)(r2)
lwzx r9,r2,r0
add r9,r9,r2
mtctr r9
bctr
.align 2
L6:
.long L2-L6
.long L2-L6
.long L2-L6
.long L2-L6
.long L3-L6
.long L4-L6
.long L5-L6
L2:
b _foo0
L5:
b _foo3
L3:
b _foo1
L4:
b _foo2
I think what is happening is that case 10-13 are being combined but not with default so we not getting
the non-switch (ifs) table actional here.
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|enhancement |normal
Status|UNCONFIRMED |NEW
Component|rtl-optimization |tree-optimization
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-09-07 08:54:08
date| |
Summary|a dispatch table can be |[3.5 Regression] a dispatch
|shortened for certain switch|table can be shortened for
|statements |certain switch statements
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17343