This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ridiculous amounts of padding



> OpenBSD is considering switching to egcs 1.1.1 (or a later release :) )
> from gcc 2.8.1.
> 
> The main stumbling block is that code output by egcs under -O2 on 
> i386-aout is *larger* than code output by gcc 2.8.1.

It may be that -Os is more appropriate for a kernel, where the code is
permanently in memory.

> Something like 30K for a 2MB kernel, which is somewhat large.

30K/2MB = 1.46%.  I would call this measurable, but not somewhat large.
The question is whether the marginally larger code is faster, or if it
is just worse.

> ... plus some differing passes, since egcs has changed. The gcse seems to be
> the main offender... -Os improved the code size, -fno-gcse improved it some
> more, relaxing constant string alignment improved almost *nothing*.

You can choose to recommend whatever flags you wish: e.g. -Os and -fno-gcse.

> This is a real problem: for performance freaks that care only about C
> code quality, it seems that at least on i386, egcs is a bad idea: code is
> larger, and looking at assembler fragments does not indicate a trade-off
> between code size and efficiency.

Unfortunately, we don't systematically run benchmarks, so developers can't
really tell when they are introducing performance regressions.

> It may well be that I'm mistaken, or that I'm missing something obvious.
> But until someone corrects me (or I find a solution myself), OpenBSD will
> have to stay with gcc 2.8.1 (as much as I would like a change, personally).

That's your call, though if any OpenBSD users want to use C++, you aren't
doing them any favors by giving them 2.8.1.  A third option is to help
make egcs better and then switch once 1.2 is available.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]