This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Serious code size regression from 3.0.2 to now
- From: Geoff Keating <geoffk at geoffk dot org>
- To: tm <tm at mail dot kloo dot net>, Joern Rennecke <joern dot rennecke at superh dot com>
- Cc: gcc-bugs at gcc dot gnu dot org, stephen dot clarke at superh dot com, shumpei dot kawasaki at hsa dot hitachi dot com
- Date: 23 Jul 2002 15:54:21 -0700
- Subject: Re: Serious code size regression from 3.0.2 to now
- References: <Pine.LNX.4.21.0207231526001.5453-100000@mail.kloo.net>
It sounds like at least one of the problems is that very short
sequences of code are being made to each align at the start of a cache line,
but if you have (for example, not any particular real processor)
.align 5
mov r0,#1
b L123
.align 5
mov r0,#2
b L124
...
you don't need the second '.align', since the next chunk will be fully
contained in a cache line.
If this is done properly, most short code sequences won't need extra
alignment...
One tricky bit is that sometimes multiple alignments are helpful, for instance
.align 5
b L123
.align 5
mov r0,#2
b L124
the middle '.align' might need to be a '.align 3' (rather than
deleted) if it will help to keep code aligned to two-instruction
boundaries. This is still much better than the original, though.
This would be a helpful project. Perhaps it should go on the projects page?
--
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>