This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Long term code compactness regression
- To: Aaron Lehmann <aaronl at vitelus dot com>
- Subject: Re: Long term code compactness regression
- From: Marcus Meissner <Marcus dot Meissner at caldera dot de>
- Date: Mon, 29 Oct 2001 10:13:57 +0100
- Cc: gcc at gcc dot gnu dot org
- References: <20011026150938.C25756@vitelus.com>
On Fri, Oct 26, 2001 at 03:09:38PM -0700, Aaron Lehmann wrote:
> I compiled the Linux software package busybox with three different
> compiler versions on i386.
>
> compiler opt size
> gcc 2.7.2.3 -O2 213116
> gcc 2.95.4-pre -Os 216652
> gcc 3.0.2-pre -Os 222012
>
> Binaries were stripped, and the .note and .comment sections were
> removed.
>
> This is indicating that gcc 2.7.2.3 does *better* with -O2 than 2.95
> and 3.x with -Os. If I broke these down to specific testcases and
> compared the assembly output, would anyone look at fixing the behavior
> of -Os?
Following patch might help if there are longer strings.
Without it, gcc will align all strings longer than 31 characters at
a 32 BYTE boundary.
Ciao, Marcus
--- gcc-2.95.2/gcc/config/i386/i386.h.size Thu Oct 18 10:29:01 2001
+++ gcc-2.95.2/gcc/config/i386/i386.h Thu Oct 18 10:29:47 2001
@@ -454,7 +454,7 @@
? 128 \
: (ALIGN)) \
: TREE_CODE (EXP) == STRING_CST \
- ? ((TREE_STRING_LENGTH (EXP) >= 31 && (ALIGN) < 256) \
+ ? (!optimize_size && ((TREE_STRING_LENGTH (EXP) >= 31 && (ALIGN) < 256)) \
? 256 \
: (ALIGN)) \
: (ALIGN))