Subject: Re: gcc 4.1.2 'regression'
To: David Laight <david@l8s.co.uk>
From: Simon Burge <simonb@NetBSD.org>
List: tech-toolchain
Date: 11/24/2006 16:02:22
David Laight wrote:

> Before removing them from the build, I was looking at why the rescue-tiny
> floppy was overflowing.  A quick comparison with my 4.0 tree shows that
> a lot of the object files are now larger (and larger than they were with
> gcc 3.3.3).
> 
> Code generated by gcc 4.1.2 20061021 (prerelease) (NetBSD nb1 20061021) is
> larger than that of gcc 4.1.2 20060628 (prerelease) (NetBSD nb2 20060711)
> 
> For instance distrib/ustils/more/input.o (in ramdiskbin) grows from 0x22a
> to 0x25a bytes (it was 228 with 3.3.3).
> 
> Not the least of the problem is that it seemd to copy argument to locals!
> 
> Anyone any thoughts - should I raise it with gcc ?

At least for mips, gcc 4.1.2 builds smaller code than gcc 3.3.3, with a
rough estimate of 10% smaller, and up to 15% in some cases.  Here's a
few examples built from the same source tree:

   text    data     bss     dec     hex filename
   3320     156      52    3528     dc8 rhone.root-EL-gcc3/bin/sync
   2841     164      52    3057     bf1 rhone.root-EL-gcc4/bin/sync
 213600    5976   19728  239304   3a6c8 rhone.root-EL-gcc3/bin/csh
 183863    6016   19728  209607   332c7 rhone.root-EL-gcc4/bin/csh
 533701   17820  343984  895505   daa11 rhone.root-EL-gcc3/bin/tcsh
 475345   17804   82564  575713   8c8e1 rhone.root-EL-gcc4/bin/tcsh
1127357   26572   64736 1218665  129869 rhone.root-EL-gcc3/lib/libc.so.12.141
1010955   26148   64736 1101839  10d00f rhone.root-EL-gcc4/lib/libc.so.12.141
2245207   26164    7312 2278683  22c51b rhone.root-EL-gcc3/usr/sbin/named
1966082   25292    7312 1998686  1e7f5e rhone.root-EL-gcc4/usr/sbin/named
2747655   81984   81192 2910831  2c6a6f rhone.root-EL-gcc3/usr/bin/gdb
2360981   81452   80980 2523413  268115 rhone.root-EL-gcc4/usr/bin/gdb

Doesn't really help you, but points that it seems to be an architecture
dependent problem.

Simon.