[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
-- rguenth at gcc dot gnu dot org changed: What|Removed |Added Target Milestone|--- |4.4.5 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #36 from ibolton at gcc dot gnu dot org 2010-09-09 15:37 --- Fixed in 4.4, 4.5 and trunk. -- ibolton at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #35 from ibolton at gcc dot gnu dot org 2010-09-07 09:27 --- (In reply to comment #32) > I don't know if there are plans for more releases in the 4.4 series, but can > it > be applied to the 4.4 branch too? > The backport for 4.4 is ready. I am just waiting for approval on the mailing list, although it is probably "obvious". -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #34 from ibolton at gcc dot gnu dot org 2010-09-02 13:10 --- (In reply to comment #33) > Yes, 4.4.5 and maybe 4.4.6 is planned. > (In reply to comment #31) > (In reply to comment #30) > > (In reply to comment #28) > > > Hm, no, I was too quick pruning my inbox. The patch apparently has > > > not been applied to the 4.5 branch. > > > > > > > It's on its way. I've been testing in conjunction with a couple of other > > backports and ran into some issues unrelated to this patch. I'm hoping to > > be > > ready to apply to 4.5 tomorrow. > > > > OK, reassigning to you then. Please do not forget to add a hunk > adding the new dependence of tree-switch-conversion.o in Makefile.in. > > Thanks. > I have just committed the backport to 4.5 branch. I will start on the 4.4 backport now, but I will need to do the usual testing before it is ready ... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #33 from jakub at gcc dot gnu dot org 2010-09-01 11:50 --- Yes, 4.4.5 and maybe 4.4.6 is planned. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #32 from jifl-bugzilla at jifvik dot org 2010-09-01 11:47 --- I don't know if there are plans for more releases in the 4.4 series, but can it be applied to the 4.4 branch too? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #31 from jamborm at gcc dot gnu dot org 2010-09-01 11:32 --- (In reply to comment #30) > (In reply to comment #28) > > Hm, no, I was too quick pruning my inbox. The patch apparently has > > not been applied to the 4.5 branch. > > > > It's on its way. I've been testing in conjunction with a couple of other > backports and ran into some issues unrelated to this patch. I'm hoping to be > ready to apply to 4.5 tomorrow. > OK, reassigning to you then. Please do not forget to add a hunk adding the new dependence of tree-switch-conversion.o in Makefile.in. Thanks. -- jamborm at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|jamborm at gcc dot gnu dot |ibolton at gcc dot gnu dot |org |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #30 from ibolton at gcc dot gnu dot org 2010-09-01 11:25 --- (In reply to comment #28) > Hm, no, I was too quick pruning my inbox. The patch apparently has > not been applied to the 4.5 branch. > It's on its way. I've been testing in conjunction with a couple of other backports and ran into some issues unrelated to this patch. I'm hoping to be ready to apply to 4.5 tomorrow. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #29 from jamborm at gcc dot gnu dot org 2010-09-01 11:24 --- I'll do that, hopefully sooner rather than later. -- jamborm at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |jamborm at gcc dot gnu dot |dot org |org Status|REOPENED|ASSIGNED Last reconfirmed|2010-07-05 13:43:01 |2010-09-01 11:24:15 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #28 from jamborm at gcc dot gnu dot org 2010-09-01 11:23 --- Hm, no, I was too quick pruning my inbox. The patch apparently has not been applied to the 4.5 branch. -- jamborm at gcc dot gnu dot org changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #27 from jamborm at gcc dot gnu dot org 2010-09-01 11:10 --- As far as I understand it, this is fixed with http://gcc.gnu.org/ml/gcc-cvs/2010-08/msg00577.html -- jamborm at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #26 from ian dot bolton at arm dot com 2010-08-03 17:09 --- (In reply to comment #25) > (In reply to comment #24) > > (In reply to comment #23) > > > I can confirm this fails with GCC 4.4.4 and that GCC 4.3.2 works. > > > > > > > I get no warning and correct code in latest 4.4 branch (4.4.5 - 20100727), > > but > > I do get the warning and incorrect code in latest 4.5 branch (4.5.1 - > > 20100727). > > > > And trunk, as of 20100727 (4.6.0), is also OK (no warning and correct code). > > I am configuring with: > > --target=arm-unknown-eabi --with-cpu=cortex-a9 --enable-languages=c,c++ > > And building with: > > -c -O2 -mcpu=arm926ej-s -x c++ ~/pr44328.cpp -Wextra -save-temps -S > My mistake. I had incorrectly invoked the linux target compiler when doing my 4.4 testing. :-( I actually DO get the warning and incorrect code with latest 4.4 branch and 4.5 branch. Trunk does work correctly though, because the gimple pass keeps the default case and the case 0 distinct nowadays (unless you specify -fstrict-enums), whereas 4.4 and 4.5 both merge the default case in with the case 0 due to the fact that the switch enumerates all possible values of the OpenMode. Here is key line from the 004t.gimple dump for 4.4 and 4.5 (and 4.6 with -fstrict-enums): switch (D.1763) , case 0: , case 1: , case 2: , case 3: > See how default and case 0 both go to the same place. Here is the equivalent line from 004t.gimple from 4.6 (without -fstrict-enums): switch (D.1766) , case 0: , case 1: , case 2: , case 3: > See how default and case 0 go to different places. This therefore explains why 4.6 works with the reporter's commandline args. I am fairly sure the actual bug is in tree-switch-conversion.c, and I feel a bug fix is imminent. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #25 from ian dot bolton at arm dot com 2010-08-02 13:33 --- (In reply to comment #24) > (In reply to comment #23) > > I can confirm this fails with GCC 4.4.4 and that GCC 4.3.2 works. > > > > I get no warning and correct code in latest 4.4 branch (4.4.5 - 20100727), but > I do get the warning and incorrect code in latest 4.5 branch (4.5.1 - > 20100727). > And trunk, as of 20100727 (4.6.0), is also OK (no warning and correct code). I am configuring with: --target=arm-unknown-eabi --with-cpu=cortex-a9 --enable-languages=c,c++ And building with: -c -O2 -mcpu=arm926ej-s -x c++ ~/pr44328.cpp -Wextra -save-temps -S -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #24 from ian dot bolton at arm dot com 2010-08-02 12:23 --- (In reply to comment #23) > I can confirm this fails with GCC 4.4.4 and that GCC 4.3.2 works. > I get no warning and correct code in latest 4.4 branch (4.4.5 - 20100727), but I do get the warning and incorrect code in latest 4.5 branch (4.5.1 - 20100727). -- ian dot bolton at arm dot com changed: What|Removed |Added CC||ian dot bolton at arm dot ||com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #23 from jifl-bugzilla at jifvik dot org 2010-07-24 22:23 --- I can confirm this fails with GCC 4.4.4 and that GCC 4.3.2 works. -- jifl-bugzilla at jifvik dot org changed: What|Removed |Added CC||jifl-bugzilla at jifvik dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328
[Bug tree-optimization/44328] switch/case optimization produces an invalid lookup table index
--- Comment #22 from ramana at gcc dot gnu dot org 2010-07-05 13:43 --- With trunk as of a couple of days back - the testcase when compiled with -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp for EABI generates the following code for C++ but not for C. Notice the removal of the check of the condition for being out of range Z9open_filePKc8OpenMode: @ Function supports interworking. @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 stmfd sp!, {r3, lr} ldr r3, .L2 ldr r1, [r3, r1, asl #2] bl open ldmfd sp!, {r3, lr} bx lr .L3: .align 2 .L2: .word .LANCHOR0 .size _Z9open_filePKc8OpenMode, .-_Z9open_filePKc8OpenMode .section.rodata .align 2 .set.LANCHOR0,. + 0 .type CSWTCH.1, %object .size CSWTCH.1, 16 CSWTCH.1: .word 1 .word 74 .word 3 .word 75 .ident "GCC: (GNU) 4.6.0 20100702 (experimental)" Same file compiled in "C". open_file: @ Function supports interworking. @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 cmp r1, #3 stmfd sp!, {r3, lr} ldrls r3, .L4 movhi r1, #0 ldrls r1, [r3, r1, asl #2] bl open ldmfd sp!, {r3, lr} bx lr .L5: .align 2 .L4: .word .LANCHOR0 .size open_file, .-open_file .section.rodata .align 2 .set.LANCHOR0,. + 0 .type CSWTCH.1, %object .size CSWTCH.1, 16 CSWTCH.1: .word 1 .word 74 .word 3 .word 75 .ident "GCC: (GNU) 4.6.0 20100702 (experimental)" -- ramana at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Component|c++ |tree-optimization Ever Confirmed|0 |1 Known to fail||4.6.0 Last reconfirmed|-00-00 00:00:00 |2010-07-05 13:43:01 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44328