public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/51622] New: GCC generates bad code that generate big executable sizes when using _Decimal*
@ 2011-12-19 12:11 mingodad at gmail dot com
  2011-12-19 12:24 ` [Bug c/51622] " mingodad at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: mingodad at gmail dot com @ 2011-12-19 12:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51622

             Bug #: 51622
           Summary: GCC generates bad code that generate big executable
                    sizes when using _Decimal*
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mingodad@gmail.com


Created attachment 26140
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26140
Program and a batch file to show how strange is gcc code generation when using
_Decimal*

The main point here is to demonstrate that gcc is capable to generate good code
size when using _Decimal* but for some reason it get lost with some code
combinations and generates very big executables unnecessarily making a bad
balance between functionality/size.

Here is a program that demonstrate that gcc is generating bad code resulting in
big executables when using _Decimal*.

There is a main.c with several operations on _Decimal64, few on _Decimal128
with some combination of the code (with all operations) the final executable
file is 8KB but with a different combination (again with all operations) the
executable is 2.206KB or 2.2MB. This last one is very strange because the
diference betwen then is calling a printf to print several existing _Decimal64
variable (the biggest 2.2MB) and calling a printf to print only one existing
_Decimal64 variable ((double)discount_over_sales the smallest 8KB but if we try
to any other existing variables it goes to 2.2MB).

gcc -s -O2 -DWITH_TMP main.c -o smallest.exe -> 8KB
gcc -s -O2 -DWITH_ONE_BIG_PRINTF -DWITH_TMP main.c -o strange-big-size-jump.exe
-> 2.206KB or 2.2MB
gcc -s -O2 main.c -o good1.exe -> 8KB
gcc -s -O2 -DWITH_DEC128 -DWITH_ISNAN -DWITH_MPRINTF main.c printf.c -o
biggest.exe -> 2.444KB or 2.4MB
gcc -s -O2 -DWITH_MPRINTF main.c printf.c -o optimus.exe -> 154KB
gcc -s -O2 -DWITH_DEC128 -DWITH_MPRINTF main.c printf.c -o good2.exe -> 367KB


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-11-10 19:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-19 12:11 [Bug c/51622] New: GCC generates bad code that generate big executable sizes when using _Decimal* mingodad at gmail dot com
2011-12-19 12:24 ` [Bug c/51622] " mingodad at gmail dot com
2011-12-19 12:27 ` rguenth at gcc dot gnu.org
2011-12-19 12:41 ` redi at gcc dot gnu.org
2011-12-19 14:33 ` mingodad at gmail dot com
2011-12-19 14:41 ` mingodad at gmail dot com
2011-12-19 14:43 ` mingodad at gmail dot com
2011-12-19 15:31 ` jakub at gcc dot gnu.org
2011-12-19 21:39 ` mingodad at gmail dot com
2011-12-20 17:31 ` mingodad at gmail dot com
2011-12-21 10:40 ` mingodad at gmail dot com
2013-11-10 19:43 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).