[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-14 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #22 from Fredrik Hederstierna --- Was "max_ratio_for_size = 2" as default changed? Also changing this to "1" did not by far reach size of gcc-8.2 unfortunately, I guess we are assuming this code growth depends on other regression

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #23 from Martin Liška --- (In reply to Fredrik Hederstierna from comment #22) > Was "max_ratio_for_size = 2" as default changed? No. > Also changing this to "1" did not by far reach size of gcc-8.2 unfortunately, Note that the

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 Martin Liška changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #19 from Martin Liška --- Author: marxin Date: Tue May 14 10:00:53 2019 New Revision: 271156 URL: https://gcc.gnu.org/viewcvs?rev=271156=gcc=rev Log: Fix a test-case in PR middle-end/90340. 2019-05-14 marxin PR

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #20 from Martin Liška --- (In reply to Christophe Lyon from comment #18) > The new test fails on aarch64: > FAIL: gcc.dg/tree-ssa/pr90340-2.c scan-tree-dump switchlower1 ";; GIMPLE > switch case clusters: 37 88 99 100 105 110 111 115

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-13 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 Christophe Lyon changed: What|Removed |Added CC||clyon at gcc dot gnu.org --- Comment

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #17 from Martin Liška --- (In reply to Fredrik Hederstierna from comment #16) > Still you cannot reach code size as gcc-8.3.0 ? So something in new > switch-case compilation generates larger code still? The biggest difference from

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-13 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #16 from Fredrik Hederstierna --- Still you cannot reach code size as gcc-8.3.0 ? So something in new switch-case compilation generates larger code still?

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #15 from Martin Liška --- With addition of the arguments users can drive code growth more fine. May I close this PR as resolved?

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #14 from Martin Liška --- Author: marxin Date: Fri May 10 06:32:31 2019 New Revision: 271053 URL: https://gcc.gnu.org/viewcvs?rev=271053=gcc=rev Log: Add params for jump-table expansion params (PR middle-end/90340). 2019-05-10

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-07 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #13 from Martin Liška --- (In reply to Fredrik Hederstierna from comment #9) > I did the test suggested, the results was as follows > > A. gcc-8.2.0 > B. gcc-9.1.0 > C. gcc-9.1.0 -fno-jump-tables > D. gcc-9.1.0 patched

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-07 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 Martin Liška changed: What|Removed |Added Status|NEW |ASSIGNED --- Comment #12 from Martin

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #11 from Richard Biener --- (In reply to Martin Liška from comment #6) > I'm curious how much can save following patch: > > diff --git a/gcc/tree-switch-conversion.h b/gcc/tree-switch-conversion.h > index b3bc4b9ddf7..904827fa040

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-06 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #10 from Fredrik Hederstierna --- Tested also gcc-9.1.0 "max_ratio_for_size = 1" just out of curiosity results was similar compared to gcc-8.2.0: Overall CSiBE was 2 417 695 bytes (+4185 bytes, +0.17%) Example file CSiBE

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-06 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #9 from Fredrik Hederstierna --- I did the test suggested, the results was as follows A. gcc-8.2.0 B. gcc-9.1.0 C. gcc-9.1.0 -fno-jump-tables D. gcc-9.1.0 patched "max_ratio_for_size = 2" Overall CSiBE was A: 2 413 510 bytes B: 2

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-06 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #8 from Fredrik Hederstierna --- Ok, thannks, I will try to have a look at it later tonight (I'm at my regular job now ;-) Thanks/Fredrik

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #6 from Martin Liška --- (In reply to Fredrik Hederstierna from comment #5) > I use patched sources from > http://gcc.hederstierna.com/csibe I've just tried that but I see quite some compilation errors:

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #7 from Martin Liška --- > I'm curious how much can save following patch: > Plus how much can you cave with 9.1 and -fno-jump-tables?

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-06 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #5 from Fredrik Hederstierna --- I use patched sources from http://gcc.hederstierna.com/csibe I think you could download and try it out. Toolchain I build with https://github.com/fredrikhederstierna/buildbuddy Otherwise I think

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 --- Comment #4 from Martin Liška --- Simplified test-case: $ cat /tmp/csibe.c int a; int foo(char c) { switch (c) { case 'c': return a; case 's': return 3; case 'n': return 1; case '%': return -2; case 'o':

[Bug middle-end/90340] Not optimal code when compiling switch-case for size, code increase +35%

2019-05-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340 Martin Liška changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|