public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fastjar/36542] New: 300% code bloat with -O3
@ 2008-06-15 11:24 tim at klingt dot org
2008-06-15 11:25 ` [Bug fastjar/36542] " tim at klingt dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: tim at klingt dot org @ 2008-06-15 11:24 UTC (permalink / raw)
To: gcc-bugs
the attached code (preprocessed source) compiles to the following sizes:
gcc-4.2, -O2: 51072
gcc-4.2, -O3: 53492
gcc-4.3, -O2: 44976
gcc-4.3, -O3: 143736
the full command line is:
$g++ -c -OX -mfpmath=sse -msse -msse2 -fvisibility=hidden -fPIC -DNDEBUG
path/to/file
gcc-4.3 -v:
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.1-2'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3
--program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-mpfr --enable-targets=all --enable-cld
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.3.1 (Debian 4.3.1-2)
--
Summary: 300% code bloat with -O3
Product: gcc
Version: 4.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fastjar
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tim at klingt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36542
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fastjar/36542] 300% code bloat with -O3
2008-06-15 11:24 [Bug fastjar/36542] New: 300% code bloat with -O3 tim at klingt dot org
@ 2008-06-15 11:25 ` tim at klingt dot org
2008-06-15 12:37 ` [Bug middle-end/36542] " pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: tim at klingt dot org @ 2008-06-15 11:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from tim at klingt dot org 2008-06-15 11:24 -------
Created an attachment (id=15772)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15772&action=view)
compressed preprocessed source
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36542
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/36542] 300% code bloat with -O3
2008-06-15 11:24 [Bug fastjar/36542] New: 300% code bloat with -O3 tim at klingt dot org
2008-06-15 11:25 ` [Bug fastjar/36542] " tim at klingt dot org
@ 2008-06-15 12:37 ` pinskia at gcc dot gnu dot org
2008-06-15 12:38 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-15 12:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2008-06-15 12:36 -------
-O3 enables the vectorizer in 4.3 and above so that might be the cause of the
bloat.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|fastjar |middle-end
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36542
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/36542] 300% code bloat with -O3
2008-06-15 11:24 [Bug fastjar/36542] New: 300% code bloat with -O3 tim at klingt dot org
2008-06-15 11:25 ` [Bug fastjar/36542] " tim at klingt dot org
2008-06-15 12:37 ` [Bug middle-end/36542] " pinskia at gcc dot gnu dot org
@ 2008-06-15 12:38 ` pinskia at gcc dot gnu dot org
2008-06-15 12:43 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-15 12:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2008-06-15 12:37 -------
Oh the loop versioning is enabled with the vectorizer which means we could
duplicate the loop a couple of times for aliasing versioning. I bet this is
not really a bug. -O3 is defined to cause this code bloat.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36542
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/36542] 300% code bloat with -O3
2008-06-15 11:24 [Bug fastjar/36542] New: 300% code bloat with -O3 tim at klingt dot org
` (2 preceding siblings ...)
2008-06-15 12:38 ` pinskia at gcc dot gnu dot org
@ 2008-06-15 12:43 ` pinskia at gcc dot gnu dot org
2008-06-15 13:00 ` tim at klingt dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-15 12:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2008-06-15 12:43 -------
Try -O3 -fno-tree-vectorize and report the results. If the code size is back
to normal then this is not a bug. The vectorizer will cause this code bloat on
purpose for speed reasons.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36542
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/36542] 300% code bloat with -O3
2008-06-15 11:24 [Bug fastjar/36542] New: 300% code bloat with -O3 tim at klingt dot org
` (3 preceding siblings ...)
2008-06-15 12:43 ` pinskia at gcc dot gnu dot org
@ 2008-06-15 13:00 ` tim at klingt dot org
2008-06-15 13:40 ` pinskia at gcc dot gnu dot org
2008-06-15 14:02 ` tim at klingt dot org
6 siblings, 0 replies; 8+ messages in thread
From: tim at klingt dot org @ 2008-06-15 13:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from tim at klingt dot org 2008-06-15 13:00 -------
i don't think it is related to the vectorizer:
gcc-4.3, -O3 -fno-tree-vectorize: 137088
gcc-4.3, -O3: 137016
gcc-4.3, -O3 -ftree-vectorize: 54640
gcc-4.3, -O3: 54564
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36542
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/36542] 300% code bloat with -O3
2008-06-15 11:24 [Bug fastjar/36542] New: 300% code bloat with -O3 tim at klingt dot org
` (4 preceding siblings ...)
2008-06-15 13:00 ` tim at klingt dot org
@ 2008-06-15 13:40 ` pinskia at gcc dot gnu dot org
2008-06-15 14:02 ` tim at klingt dot org
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-15 13:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2008-06-15 13:40 -------
Then it is the complete unroller which means that it is unrolling the loop
fully which is expected from creating the code bloat.
This is not a bug based on that fact.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36542
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/36542] 300% code bloat with -O3
2008-06-15 11:24 [Bug fastjar/36542] New: 300% code bloat with -O3 tim at klingt dot org
` (5 preceding siblings ...)
2008-06-15 13:40 ` pinskia at gcc dot gnu dot org
@ 2008-06-15 14:02 ` tim at klingt dot org
6 siblings, 0 replies; 8+ messages in thread
From: tim at klingt dot org @ 2008-06-15 14:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from tim at klingt dot org 2008-06-15 14:01 -------
i see ... is it possible to enable the complete unroller manually?
from my understanding gcc-4.3 -O3 is the same as -O2 -fgcse-after-reload
-finline-functions -fpredictive-commoning -ftree-vectorize -funswitch-loops ...
using these optimizations manually don't bloat the code, though ...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36542
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-06-15 14:02 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-15 11:24 [Bug fastjar/36542] New: 300% code bloat with -O3 tim at klingt dot org
2008-06-15 11:25 ` [Bug fastjar/36542] " tim at klingt dot org
2008-06-15 12:37 ` [Bug middle-end/36542] " pinskia at gcc dot gnu dot org
2008-06-15 12:38 ` pinskia at gcc dot gnu dot org
2008-06-15 12:43 ` pinskia at gcc dot gnu dot org
2008-06-15 13:00 ` tim at klingt dot org
2008-06-15 13:40 ` pinskia at gcc dot gnu dot org
2008-06-15 14:02 ` tim at klingt dot 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).