Date: Sun, 30 Jan 2000 14:11:11 +0100 From: Marc Lehmann To: pgcc AT delorie DOT com Subject: Re: pgcc and egcs alignment -- function, basic block and string Message-ID: <20000130141111.E549@cerebro.laendle> Mail-Followup-To: pgcc AT delorie DOT com References: <38921CD6 DOT 2A725779 AT ix DOT netcom DOT com> <20000129032101 DOT A25630 AT atrey DOT karlin DOT mff DOT cuni DOT cz> <38927310 DOT 2033EED4 AT ix DOT netcom DOT com> <20000130011444 DOT A32728 AT atrey DOT karlin DOT mff DOT cuni DOT cz> <20000130000138 DOT B7075 AT cordes DOT phys DOT dal DOT ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20000130000138.B7075@cordes.phys.dal.ca>; from peter@Cordes.Phys.Dal.Ca on Sun, Jan 30, 2000 at 12:01:38AM -0400 X-Operating-System: Linux version 2.2.14 (root AT cerebro) (gcc version 2.95.1 19990816 (release)) Reply-To: pgcc AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: pgcc AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, Jan 30, 2000 at 12:01:38AM -0400, peter AT Cordes DOT Phys DOT Dal DOT Ca wrote: > Is it possible for gcc to look for gaps to put short strings into? No, thats what the linker has to do. AFAIK gnuld does not have an option to sort the data (and doing that actually breaks "common unix sense", such as used in emacs). gnuld can do it for common symbols, though. gcc can put each data declaration into it's own sections. > a function along the the next alignment boundary is wasted. I'm saying gcc > should see if there are any strings which will fit in that space.) gcc really does not know how large a function is. its a linker issue (which is outside of gccs control). > For the string optimization, it would be really good to be able to do > cross-file optimization, because then the short strings could all find Yeah ;-> Could be solved in the linker. Maybe it's time for "pld" ;) > homes... OTOH, putting a string right after the ret from a function which Many cpus penalize this kind o construct. It would be easy to add a -mrodata switch (like it already exists for the ARC) to select behaviour. > assumed to use it) makes a _lot_ of sense (to me...). Such strings should It may make a lot of sense if your goal is space. But when you want alignment you want alignment, and then packing is not always useful.. -- -----==- | ----==-- _ | ---==---(_)__ __ ____ __ Marc Lehmann +-- --==---/ / _ \/ // /\ \/ / pcg AT opengroup DOT org |e| -=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE --+ The choice of a GNU generation | |