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

fredrik.hederstierna@securitas-direct.com gcc-bugzilla@gcc.gnu.org
Mon May 6 21:12:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90340

--- Comment #9 from Fredrik Hederstierna <fredrik.hederstierna@securitas-direct.com> ---
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 417 915 bytes (+4405 bytes, +0.18%)
C: 2 423 413 bytes (+9903 bytes, +0.41%)
D: 2 417 739 bytes (+4229 bytes, +0.18%)

Example file CSiBE "vsprintf.c" was

A: 2369 bytes
B: 2589 bytes (+220 bytes, +9.3%)
C: 2445 bytes ( +76 bytes, +3.2%)
D: 2489 bytes (+120 bytes, +5.1%)

So it didn't really solve it, but made it better possibly,
though there are othre code size regression aswell for gcc-9.1.0 which might
also affect results..


More information about the Gcc-bugs mailing list