public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18418] New: GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions
@ 2004-11-10 13:52 ayqazi at yahoo dot co dot uk
  2004-11-10 13:54 ` [Bug c++/18418] " ayqazi at yahoo dot co dot uk
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: ayqazi at yahoo dot co dot uk @ 2004-11-10 13:52 UTC (permalink / raw)
  To: gcc-bugs

Hi,

Using a template expressions 3D maths library I'm developing, I have discovered
that GCC 3.4.3 builds worse code than GCC 3.3.4 (and predecessors.)

I have attached a test case file using a part of the template expression library
that highlights this case.

Regardless of which -march flag I used to compile it (i386, etc.) and regardless
of the -msse flag being present or not, the asm output was clearly longer by
about 20% in the gcc 3.4.3 compiled code.

p.s. it will work if an optimisation flag is present (I have verified it.) 
Without an optimisation flag, GCC doesn't generate proper code (this bug has
already been reported.)

-- 
           Summary: GCC 3.4.3 builds worse code than GCC 3.3.4 using
                    template expressions
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ayqazi at yahoo dot co dot uk
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-linux
  GCC host triplet: i686-linux
GCC target triplet: i686-linux


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


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

* [Bug c++/18418] GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions
  2004-11-10 13:52 [Bug c++/18418] New: GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions ayqazi at yahoo dot co dot uk
@ 2004-11-10 13:54 ` ayqazi at yahoo dot co dot uk
  2004-11-10 14:07 ` [Bug c++/18418] [3.4 only] " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: ayqazi at yahoo dot co dot uk @ 2004-11-10 13:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ayqazi at yahoo dot co dot uk  2004-11-10 13:54 -------
Created an attachment (id=7516)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7516&action=view)
Test case for differences in GCC 3.4.3 and 3.3.4 template expression code gen

Compile to assembler (e.g. g++ -S -O) using same flags with both a GCC 3.3
series compiler, and a GCC 3.4 series compiler and spot the file length
difference - you MUST use an optimisation flag for it to compile correctly
(another bug, already submitted.)


-- 


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


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

* [Bug c++/18418] [3.4 only] GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions
  2004-11-10 13:52 [Bug c++/18418] New: GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions ayqazi at yahoo dot co dot uk
  2004-11-10 13:54 ` [Bug c++/18418] " ayqazi at yahoo dot co dot uk
@ 2004-11-10 14:07 ` pinskia at gcc dot gnu dot org
  2004-11-10 18:52 ` giovannibajo at libero dot it
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-10 14:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-10 14:07 -------
First this is invalid code as explained in PR 18415.
Second this works fine on the mainline as get close to optimial code.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
      Known to work|                            |4.0.0 3.3.3
            Summary|GCC 3.4.3 builds worse code |[3.4 only] GCC 3.4.3 builds
                   |than GCC 3.3.4 using        |worse code than GCC 3.3.4
                   |template expressions        |using template expressions
   Target Milestone|---                         |3.4.4


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


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

* [Bug c++/18418] [3.4 only] GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions
  2004-11-10 13:52 [Bug c++/18418] New: GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions ayqazi at yahoo dot co dot uk
  2004-11-10 13:54 ` [Bug c++/18418] " ayqazi at yahoo dot co dot uk
  2004-11-10 14:07 ` [Bug c++/18418] [3.4 only] " pinskia at gcc dot gnu dot org
@ 2004-11-10 18:52 ` giovannibajo at libero dot it
  2005-02-10  0:11 ` bangerth at dealii dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: giovannibajo at libero dot it @ 2004-11-10 18:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-11-10 18:52 -------
Notice that I would prefer to see a runtime benchmark before confirming this 
bug. A 20% increase in code size could probably be caused by better inlining -- 
it does not automatically means that the code is slower unless you prove 
otherwise.

If you compile with -O2, you should test run-time speed with a run-time 
benchmark: try doing some calculations and time them with different compilers. 
If you care about code size, try with -Os.

-- 


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


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

* [Bug c++/18418] [3.4 only] GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions
  2004-11-10 13:52 [Bug c++/18418] New: GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions ayqazi at yahoo dot co dot uk
                   ` (2 preceding siblings ...)
  2004-11-10 18:52 ` giovannibajo at libero dot it
@ 2005-02-10  0:11 ` bangerth at dealii dot org
  2005-02-10 20:48 ` ayqazi at yahoo dot co dot uk
  2005-05-19 17:38 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2005-02-10  0:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2005-02-09 19:24 -------
There's also other stuff lurking in assembler files, such as a lot of 
notes for labels. These aren't code, and I've seen cases where newer 
compilers output more labels than older ones for some reason. 
 
Unless you show us some run-time comparisons, I guess there isn't much 
willingness here to do something about it. I'll put this PR into "waiting" 
state. 
 
Thanks 
  Wolfgang 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug c++/18418] [3.4 only] GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions
  2004-11-10 13:52 [Bug c++/18418] New: GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions ayqazi at yahoo dot co dot uk
                   ` (3 preceding siblings ...)
  2005-02-10  0:11 ` bangerth at dealii dot org
@ 2005-02-10 20:48 ` ayqazi at yahoo dot co dot uk
  2005-05-19 17:38 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 9+ messages in thread
From: ayqazi at yahoo dot co dot uk @ 2005-02-10 20:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ayqazi at yahoo dot co dot uk  2005-02-10 17:23 -------
Once GCC 4.0 is out, I'll experiment with it and submit test cases etc. for it.
 No use trying to fix an older release's optimisations IMHO.

Thanks anyway.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |SUSPENDED


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


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

* [Bug c++/18418] [3.4 only] GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions
  2004-11-10 13:52 [Bug c++/18418] New: GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions ayqazi at yahoo dot co dot uk
                   ` (4 preceding siblings ...)
  2005-02-10 20:48 ` ayqazi at yahoo dot co dot uk
@ 2005-05-19 17:38 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:38 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.4                       |3.4.5


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


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

* [Bug c++/18418] [3.4 only] GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions
       [not found] <bug-18418-2716@http.gcc.gnu.org/bugzilla/>
  2005-10-07  3:32 ` gdr at gcc dot gnu dot org
@ 2006-02-28  9:45 ` gdr at gcc dot gnu dot org
  1 sibling, 0 replies; 9+ messages in thread
From: gdr at gcc dot gnu dot org @ 2006-02-28  9:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from gdr at gcc dot gnu dot org  2006-02-28 09:44 -------
won't fix for 3.4.6


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |RESOLVED
         Resolution|                            |WONTFIX


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


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

* [Bug c++/18418] [3.4 only] GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions
       [not found] <bug-18418-2716@http.gcc.gnu.org/bugzilla/>
@ 2005-10-07  3:32 ` gdr at gcc dot gnu dot org
  2006-02-28  9:45 ` gdr at gcc dot gnu dot org
  1 sibling, 0 replies; 9+ messages in thread
From: gdr at gcc dot gnu dot org @ 2005-10-07  3:32 UTC (permalink / raw)
  To: gcc-bugs



-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.5                       |3.4.6


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


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

end of thread, other threads:[~2006-02-28  9:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-10 13:52 [Bug c++/18418] New: GCC 3.4.3 builds worse code than GCC 3.3.4 using template expressions ayqazi at yahoo dot co dot uk
2004-11-10 13:54 ` [Bug c++/18418] " ayqazi at yahoo dot co dot uk
2004-11-10 14:07 ` [Bug c++/18418] [3.4 only] " pinskia at gcc dot gnu dot org
2004-11-10 18:52 ` giovannibajo at libero dot it
2005-02-10  0:11 ` bangerth at dealii dot org
2005-02-10 20:48 ` ayqazi at yahoo dot co dot uk
2005-05-19 17:38 ` mmitchel at gcc dot gnu dot org
     [not found] <bug-18418-2716@http.gcc.gnu.org/bugzilla/>
2005-10-07  3:32 ` gdr at gcc dot gnu dot org
2006-02-28  9:45 ` gdr at gcc dot gnu 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).