public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gabriel Paubert <paubert@iram.es>
To: Sergei Poselenov <sposelenov@emcraft.com>
Cc: Andrew Haley <aph@redhat.com>, gcc@gcc.gnu.org, 	"'rt'" <rt@emcraft.com>
Subject: Re: powercp-linux cross GCC 4.2 vs GCC 4.0.0: -Os code size regression?  [Emcraft #11717]
Date: Thu, 17 Jan 2008 18:27:00 -0000	[thread overview]
Message-ID: <20080117180819.GA26457@iram.es> (raw)
In-Reply-To: <478F6AAA.4090402@emcraft.com>

On Thu, Jan 17, 2008 at 05:48:10PM +0300, Sergei Poselenov wrote:
> Hello Andrew,
> 
> Andrew Haley wrote:
> >Sergei Poselenov writes:
> > > Hello Andrew,
> > > 
> > > > Now, I sympathize that in your particular case you have a code size
> > > > regression.  This happens: when we do optimization in gcc, some code
> > > > bases will lose out.  All that we can promise is that we try not to
> > > > make it worse for most users.
> > > > 
> > > > What we can do is compare your code that has got much worse, and try
> > > > to figure out why.
> > > > 
> > > 
> > > Would the generated asm listings be enough? Or should I send
> > > the preprocessed sources as well?
> >
> >Both.
> >
> >Rather than sending stuff, best to stick it on a web site if you can.
> >
> 
> Here it is:
> Preprocessed and assembler code generated by the GCC 4.2.2 ppc-linux
> cross-compiler:
> http://www.emcraft.com/codesize/gcc-4.2.2/interrupts.i
> http://www.emcraft.com/codesize/gcc-4.2.2/interrupts.s
> 
> The same code built with gcc-4.0.0 cross-compiler:
> http://www.emcraft.com/codesize/gcc-4.0.0/interrupts.i
> http://www.emcraft.com/codesize/gcc-4.0.0/interrupts.s
> 

The functions do not appear in the same order in both files, it's a
bit surprising! Anyway look for example at irq_install_handler:

- gcc-4.0 saves all registers using stmw r24,xx(r1) and restores them
with lmw r24,xx(r1) however this means that r29 is overwritten in 
the epilogue.

- gcc-4.2.2 saves and restores registers individually which
means that it takes 12 more instructions. There go 48 bytes.

This is especially visible in the epilogue (in the prologue
the saves are interspersed with other instructions).

In this case -ffixed-r29 hurts, but gcc4.2.2 looks more correct.

	Regards,
	Gabriel

  parent reply	other threads:[~2008-01-17 18:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-16 11:24 powercp-linux cross GCC 4.2 vs GCC 4.0.0: -Os code size regression? Sergei Poselenov
2008-01-16 12:15 ` Duncan Sands
2008-01-16 12:19   ` Sergei Poselenov
2008-01-16 12:35     ` Duncan Sands
2008-01-16 13:20     ` Andrew Haley
2008-01-16 13:17 ` Andrew Haley
2008-01-16 15:59   ` Sergei Poselenov
2008-01-16 17:10     ` Andrew Haley
2008-01-16 17:14       ` Sergei Poselenov
2008-01-16 19:36         ` Andrew Haley
2008-01-17 14:52           ` powercp-linux cross GCC 4.2 vs GCC 4.0.0: -Os code size regression? [Emcraft #11717] Sergei Poselenov
2008-01-17 15:11             ` Richard Guenther
2008-01-17 18:27             ` Gabriel Paubert [this message]
2008-01-19 16:26               ` Andrew Haley
2008-01-19 16:35                 ` David Edelsohn
2008-01-19 16:51                   ` Andrew Haley
2008-01-19 19:10                     ` David Edelsohn
2008-01-21 17:25                     ` powercp-linux cross GCC 4.2 vs GCC 4.0.0: -Os code size regression? (filed bug 34903)[Emcraft #11717] Sergei Poselenov
2008-01-17 12:14     ` powercp-linux cross GCC 4.2 vs GCC 4.0.0: -Os code size regression? Gabriel Paubert
2008-01-17 12:47       ` Sergei Poselenov
2008-01-17 13:10         ` Gabriel Paubert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080117180819.GA26457@iram.es \
    --to=paubert@iram.es \
    --cc=aph@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=rt@emcraft.com \
    --cc=sposelenov@emcraft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).