* [Bug c++/48809] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
@ 2011-04-28 18:35 ` andrewcmartin at msn dot com
2011-04-28 18:36 ` andrewcmartin at msn dot com
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: andrewcmartin at msn dot com @ 2011-04-28 18:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
--- Comment #2 from andrewcmartin at msn dot com 2011-04-28 18:33:40 UTC ---
Created attachment 24133
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24133
-save-temps .o file
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/48809] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
2011-04-28 18:35 ` [Bug c++/48809] " andrewcmartin at msn dot com
@ 2011-04-28 18:36 ` andrewcmartin at msn dot com
2011-04-28 18:39 ` andrewcmartin at msn dot com
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: andrewcmartin at msn dot com @ 2011-04-28 18:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
--- Comment #1 from andrewcmartin at msn dot com 2011-04-28 18:33:10 UTC ---
Created attachment 24132
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24132
-save-temps .ii file
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/48809] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
2011-04-28 18:35 ` [Bug c++/48809] " andrewcmartin at msn dot com
2011-04-28 18:36 ` andrewcmartin at msn dot com
@ 2011-04-28 18:39 ` andrewcmartin at msn dot com
2011-04-28 18:54 ` [Bug c++/48809] [4.4/4.5/4.6/4.7 Regression] " jakub at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: andrewcmartin at msn dot com @ 2011-04-28 18:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
--- Comment #3 from andrewcmartin at msn dot com 2011-04-28 18:34:10 UTC ---
Created attachment 24134
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24134
-save-temps .s file
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/48809] [4.4/4.5/4.6/4.7 Regression] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
` (2 preceding siblings ...)
2011-04-28 18:39 ` andrewcmartin at msn dot com
@ 2011-04-28 18:54 ` jakub at gcc dot gnu.org
2011-04-29 13:40 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-28 18:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.04.28 18:50:45
CC| |jakub at gcc dot gnu.org
Target Milestone|--- |4.4.7
Summary|switch statement |[4.4/4.5/4.6/4.7
|optimization error |Regression] switch
| |statement optimization
| |error
Ever Confirmed|0 |1
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-28 18:50:45 UTC ---
Confirmed, goes away with -fno-tree-switch-conversion.
extern void abort (void);
int
foo (signed char x)
{
int y = 0;
switch (x)
{
case 0: y = 1; break;
case 1: y = 2; break;
case 2: y = 3; break;
case 3: y = 4; break;
case 4: y = 5; break;
case 5: y = 6; break;
case 6: y = 7; break;
case 7: y = 8; break;
case 8: y = 9; break;
case 9: y = 10; break;
case 10: y = 11; break;
case 11: y = 12; break;
case 12: y = 13; break;
case 13: y = 14; break;
case 14: y = 15; break;
case 15: y = 16; break;
case 16: y = 17; break;
case 98: y = 18; break;
case -62: y = 19; break;
}
return y;
}
int
main ()
{
signed char x = 98;
if (foo (x) != 18)
abort ();
}
Will look at it tomorrow.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/48809] [4.4/4.5/4.6/4.7 Regression] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
` (3 preceding siblings ...)
2011-04-28 18:54 ` [Bug c++/48809] [4.4/4.5/4.6/4.7 Regression] " jakub at gcc dot gnu.org
@ 2011-04-29 13:40 ` jakub at gcc dot gnu.org
2011-04-30 6:55 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-29 13:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-29 13:38:08 UTC ---
Created attachment 24145
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24145
gcc46-pr48809.patch
Untested fix.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/48809] [4.4/4.5/4.6/4.7 Regression] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
` (4 preceding siblings ...)
2011-04-29 13:40 ` jakub at gcc dot gnu.org
@ 2011-04-30 6:55 ` jakub at gcc dot gnu.org
2011-04-30 7:01 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-30 6:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-30 06:54:06 UTC ---
Author: jakub
Date: Sat Apr 30 06:54:02 2011
New Revision: 173207
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173207
Log:
PR tree-optimization/48809
* tree-switch-conversion.c (build_arrays): Compute tidx in unsigned
type.
(gen_inbound_check): Don't compute index_expr - range_min in utype
again, instead reuse SSA_NAME initialized in build_arrays.
Remove two useless gsi_for_stmt calls.
* gcc.c-torture/execute/pr48809.c: New test.
Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr48809.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-switch-conversion.c
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/48809] [4.4/4.5/4.6/4.7 Regression] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
` (5 preceding siblings ...)
2011-04-30 6:55 ` jakub at gcc dot gnu.org
@ 2011-04-30 7:01 ` jakub at gcc dot gnu.org
2011-04-30 7:36 ` [Bug c++/48809] [4.4/4.5 " jakub at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-30 7:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-30 06:55:15 UTC ---
Author: jakub
Date: Sat Apr 30 06:55:11 2011
New Revision: 173208
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173208
Log:
PR tree-optimization/48809
* tree-switch-conversion.c (build_arrays): Compute tidx in unsigned
type.
(gen_inbound_check): Don't compute index_expr - range_min in utype
again, instead reuse SSA_NAME initialized in build_arrays.
Remove two useless gsi_for_stmt calls.
* gcc.c-torture/execute/pr48809.c: New test.
Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/execute/pr48809.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/tree-switch-conversion.c
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/48809] [4.4/4.5 Regression] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
` (6 preceding siblings ...)
2011-04-30 7:01 ` jakub at gcc dot gnu.org
@ 2011-04-30 7:36 ` jakub at gcc dot gnu.org
2011-05-03 16:43 ` [Bug testsuite/48809] " jakub at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-30 7:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.4/4.5/4.6/4.7 |[4.4/4.5 Regression] switch
|Regression] switch |statement optimization
|statement optimization |error
|error |
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-30 07:35:10 UTC ---
Fixed for 4.6+ so far.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug testsuite/48809] [4.4/4.5 Regression] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
` (7 preceding siblings ...)
2011-04-30 7:36 ` [Bug c++/48809] [4.4/4.5 " jakub at gcc dot gnu.org
@ 2011-05-03 16:43 ` jakub at gcc dot gnu.org
2011-05-03 17:21 ` [Bug testsuite/48809] [4.4 " jakub at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-03 16:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-03 16:37:19 UTC ---
Author: jakub
Date: Tue May 3 16:37:12 2011
New Revision: 173328
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173328
Log:
Backport from mainline
2011-04-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/48809
* tree-switch-conversion.c (build_arrays): Compute tidx in unsigned
type.
(gen_inbound_check): Don't compute index_expr - range_min in utype
again, instead reuse SSA_NAME initialized in build_arrays.
Remove two useless gsi_for_stmt calls.
* gcc.c-torture/execute/pr48809.c: New test.
Added:
branches/gcc-4_5-branch/gcc/testsuite/gcc.c-torture/execute/pr48809.c
Modified:
branches/gcc-4_5-branch/gcc/ChangeLog
branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
branches/gcc-4_5-branch/gcc/tree-switch-conversion.c
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug testsuite/48809] [4.4 Regression] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
` (8 preceding siblings ...)
2011-05-03 16:43 ` [Bug testsuite/48809] " jakub at gcc dot gnu.org
@ 2011-05-03 17:21 ` jakub at gcc dot gnu.org
2011-05-04 9:24 ` jakub at gcc dot gnu.org
2011-05-04 9:43 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-03 17:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.4/4.5 Regression] switch |[4.4 Regression] switch
|statement optimization |statement optimization
|error |error
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-03 17:17:57 UTC ---
Fixed for 4.5.4+ too.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug testsuite/48809] [4.4 Regression] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
` (9 preceding siblings ...)
2011-05-03 17:21 ` [Bug testsuite/48809] [4.4 " jakub at gcc dot gnu.org
@ 2011-05-04 9:24 ` jakub at gcc dot gnu.org
2011-05-04 9:43 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-04 9:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-04 09:19:10 UTC ---
Author: jakub
Date: Wed May 4 09:19:07 2011
New Revision: 173358
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173358
Log:
Backport from mainline
2011-04-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/48809
* tree-switch-conversion.c (build_arrays): Compute tidx in unsigned
type.
(gen_inbound_check): Don't compute index_expr - range_min in utype
again, instead reuse SSA_NAME initialized in build_arrays.
Remove two useless gsi_for_stmt calls.
* gcc.c-torture/execute/pr48809.c: New test.
Added:
branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr48809.c
Modified:
branches/gcc-4_4-branch/gcc/ChangeLog
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
branches/gcc-4_4-branch/gcc/tree-switch-conversion.c
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug testsuite/48809] [4.4 Regression] switch statement optimization error
2011-04-28 18:32 [Bug c++/48809] New: switch statement optimization error andrewcmartin at msn dot com
` (10 preceding siblings ...)
2011-05-04 9:24 ` jakub at gcc dot gnu.org
@ 2011-05-04 9:43 ` jakub at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-04 9:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48809
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-04 09:33:21 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 13+ messages in thread