public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [GCC 3.0] Bad regression, binary size
@ 2001-07-05  7:39 Marc Espie
  2001-07-05  7:51 ` Marc Espie
                   ` (3 more replies)
  0 siblings, 4 replies; 121+ messages in thread
From: Marc Espie @ 2001-07-05  7:39 UTC (permalink / raw)
  To: gcc

After fixing a few warnings, I've managed to compile OpenBSD kernels.
The results are BAD:

2.95.3 + peephole to handle stack adjustment, backported from current:
-rwxr-xr-x   1 espie    wheel     3994332 Jul  5 16:08 bsd

3.0:
-rwxr-xr-x   1 espie    wheel     4068067 Jul  5 16:35 bsd


Exact same source. Both are using -O2 -Os to compile.

This is on an i386.

This is pretty bad. Basically, it means we can't switch to 3.0 at all.

I'm going to look at the corresponding generated files, see if I can spot
some pattern.

^ permalink raw reply	[flat|nested] 121+ messages in thread
* Re: [GCC 3.0] Bad regression, binary size
@ 2001-07-23 19:42 dewar
  2001-07-24  9:27 ` Linus Torvalds
  0 siblings, 1 reply; 121+ messages in thread
From: dewar @ 2001-07-23 19:42 UTC (permalink / raw)
  To: jthorn, torvalds; +Cc: gcc

<<My argument is really the same, but with a twist: keep it alive, but
don't make it the default if it makes non-FP code bigger.
>>

It is always tricky to argue about defaults. One critical issue with defaults
is to make benchmarks work better out of the box, but the default of -O0
seriously undermines this design criterion in any case.

^ permalink raw reply	[flat|nested] 121+ messages in thread
* Re: [GCC 3.0] Bad regression, binary size
@ 2001-07-23  4:46 Jonathan Thornburg
  2001-07-23 15:14 ` Linus Torvalds
  0 siblings, 1 reply; 121+ messages in thread
From: Jonathan Thornburg @ 2001-07-23  4:46 UTC (permalink / raw)
  To: gcc; +Cc: Jonathan Thornburg

In message <URL: http://gcc.gnu.org/ml/gcc/2001-07/msg00617.html >,
Linus Torvalds <torvalds at transmeta dot com> wrote
> I would argue that floating point is a lot more special than kernels are.
> I bet the code generation and optimization issues for kernels tend to be
> closer to most programs than FP code tends to be. Which is why I think it
> is the FP code that should be special-cased, not the kernel.

I think this is a fundamental philosophical point... with which I
strongly disagree.  The problem is that referring to "most" programs
begs the question of just which sort of workload you're sampling.

I'd like to put in a voice to urge that fp performance continue to be
treated as "important".  Indeed, the integer programs that _I_ use
(including OS kernels, shells, web browsers, not to mention gcc itself)
are generally either not CPU-bound, or are already "fast enough", so
I really don't care very much about integer performance.  But the fp
codes I develop and use for a living are all painfully slow, and the
science I'm doing with them would be a lot better if they were faster,
so I care a lot about fp performance.

And yes, there are people doing serious fp on x86.  It may be a kludge
of an architecture, but sometimes money talks... and the newer x86 cpus
have significantly improved fp over older ones.

So please, keep those fp-performance options (eg 16-byte stack alignment
without having to always use a frame pointer on x86) alive for those of
us who care!

-- 
-- Jonathan Thornburg <jthorn@thp.univie.ac.at>
   Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut),
   Golm, Germany             http://www.aei.mpg.de/~jthorn/home.html
   "C++ is to programming as sex is to reproduction. Better ways might
    technically exist but they're not nearly as much fun." -- Nikolai Irgens

^ permalink raw reply	[flat|nested] 121+ messages in thread
* Re: [GCC 3.0] Bad regression, binary size
@ 2001-07-09 10:13 dewar
  2001-07-09 10:37 ` Linus Torvalds
  0 siblings, 1 reply; 121+ messages in thread
From: dewar @ 2001-07-09 10:13 UTC (permalink / raw)
  To: Marc.Espie, torvalds; +Cc: gcc

<<I would argue that floating point is a lot more special than kernels are.
I bet the code generation and optimization issues for kernels tend to be
closer to most programs than FP code tends to be. Which is why I think it
is the FP code that should be special-cased, not the kernel.
>>

But it is not just floating-point, it is any 8 or 16 byte object, such
as a 64-bit integer, or a struct with two 32-bit fields.

^ permalink raw reply	[flat|nested] 121+ messages in thread
* Re: [GCC 3.0] Bad regression, binary size
@ 2001-07-09  7:50 dewar
  0 siblings, 0 replies; 121+ messages in thread
From: dewar @ 2001-07-09  7:50 UTC (permalink / raw)
  To: Marc.Espie, dewar; +Cc: gcc

<<If it causes us not to be able to switch to gcc 3.0.x six months from now,
it is quite serious, from my point of view...
>>

There are many reasons why a specific project might not want to switch
to a new version of the compiler, but that does not mean there is a serious
regression. For example, a project might be depending on a bug, now fixed,
and thus be delayed in switching versions of the compiler, but that does
not make it a regression.

it is really helpful NOT to overuse the technical term regression, which
simply means that *with respect to the target specifications* there is
an instance of failing to meet specs where before the spec was met.

THat's not the case here, there was no spec that your particular program
generate 0.98X space instead of 1.00X space

^ permalink raw reply	[flat|nested] 121+ messages in thread
* Re: [GCC 3.0] Bad regression, binary size
@ 2001-07-09  7:18 dewar
  2001-07-09  7:22 ` Marc Espie
  0 siblings, 1 reply; 121+ messages in thread
From: dewar @ 2001-07-09  7:18 UTC (permalink / raw)
  To: espie, gcc

<<Err... New compilers are supposed to be BETTER than old ones. Ideally, there
should be no regression at all ! What's the damn point of -Os if successive
releases of the compiler keep getting out larger and larger code ?
>>

A requirement that -Os not increase code size for any possible program is
clearly unreasonable. It may well be that some particular *size* optimization
helps nearly all programs, but not that particular one.

Or, as discussed in the thread on alignment, a change in ABI conventions
may cause code size increases that are justified in terms of general
performance improvement (obviously -Os should not affect the ABI).

<<In fact, as I stated already, this seems to be a weird linker/compiler
interaction, which I'm going to try to figure out.
>>

Well of course anytime we see some anomolous behavior like this, we should
try to understand it, and if in fact the behavior can be improved, then we
should indeed fix it. No one argues with that.

The issue is with calling this a "serious regression", that's obviously
inappropriate.

^ permalink raw reply	[flat|nested] 121+ messages in thread
* Re: [GCC 3.0] Bad regression, binary size
@ 2001-07-05  8:42 dewar
  2001-07-09  0:06 ` Marc Espie
  0 siblings, 1 reply; 121+ messages in thread
From: dewar @ 2001-07-05  8:42 UTC (permalink / raw)
  To: Marc.Espie, dewar; +Cc: gcc

<<This is a significant regression from 2.95.2. Fortunately, it does seem to
come from some linker issue which I hope to figure out, but be assured this
kind of problem is very serious.
>>

I really can't agree that a 2% difference in object size is a significant
regression. Optimization is a trade off between size and execution speed,
and you may well get variations in this range from one version of a compiler
to another.

An embedded system with only 2% headroom is an abomination.

As for fitting on a floppy, that really entirely marginal. it sounds like
you have been desparately close the floppy limit for a while, and at this
stage nothing gets distributed on floppies anyway.

^ permalink raw reply	[flat|nested] 121+ messages in thread
* Re: [GCC 3.0] Bad regression, binary size
@ 2001-07-05  8:31 dewar
  2001-07-05  8:38 ` Marc Espie
  0 siblings, 1 reply; 121+ messages in thread
From: dewar @ 2001-07-05  8:31 UTC (permalink / raw)
  To: Marc.Espie, gcc

<<2.95.3 + peephole to handle stack adjustment, backported from current:
-rwxr-xr-x   1 espie    wheel     3994332 Jul  5 16:08 bsd

3.0:
-rwxr-xr-x   1 espie    wheel     4068067 Jul  5 16:35 bsd
>>

I don't understand, are you saying that the less than 2% increase in
size is so worrisome that you cannot switch? If so, that's an odd
claim indeed.

^ permalink raw reply	[flat|nested] 121+ messages in thread
* Re: type based aliasing again
@ 1999-09-13 21:45 N8TM
  1999-09-14  4:01 ` Marc Espie
  1999-09-30 18:02 ` N8TM
  0 siblings, 2 replies; 121+ messages in thread
From: N8TM @ 1999-09-13 21:45 UTC (permalink / raw)
  To: craig; +Cc: gcc

> It's certainly within a reasonable "umbrella" approach of having
>  increasing optimization levels be about increasing reliance on
>  the code strictly conforming to the pertinent standard, even its
>  "tricky bits".
>  
>  The biggest problem I see with it right now is that we haven't
>  exactly taken that "umbrella" approach in the past in a consistent
>  way.

And it may not be the most useful scheme either.  With gcc-2.96 we are back 
to -Os being faster running most of the time than -O2 or -O3 on x86, with 
-march=pentiumpro (if applicable) and now -ffast-math (when it doesn't break 
the application) needed for best results.  We would want to continue the 
ability to get strict-aliasing at -Os.   I suppose we have no say on the 
peculiar in-lining scheme with glibc; apparently on at -O and -O2, unless 
specifically turned off; always off at -Os even when it would save space.

Commercial compilers have completely broken the old scheme of things also.  
They generally accept -O but it doesn't mean much.  Maximum optimization may 
be the default (Lahey) or normal high optimization may take quite a string of 
things like -Ofast 
-OPT:fold_reassociate=OFF:IEEE_comparisons=ON:unroll_times_max=2 -TENV:X=1 
(MipsPro).  So maybe the most confusing thing about gnu is the way the 
options have changed over time without much explanation (except for 
strict-aliasing).

Tim

^ permalink raw reply	[flat|nested] 121+ messages in thread

end of thread, other threads:[~2001-07-24  9:27 UTC | newest]

Thread overview: 121+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-05  7:39 [GCC 3.0] Bad regression, binary size Marc Espie
2001-07-05  7:51 ` Marc Espie
2001-07-05  8:07   ` Joern Rennecke
2001-07-05  8:12     ` Marc Espie
2001-07-05  8:17   ` David Edelsohn
2001-07-05  8:22     ` Marc Espie
2001-07-05 15:14 ` Geoff Keating
2001-07-07 13:09 ` Richard Henderson
2001-07-07 14:41   ` Jamie Lokier
2001-07-07 16:45     ` Richard Henderson
2001-07-08 14:28       ` Linus Torvalds
2001-07-08 23:59         ` Marc Espie
2001-07-09  6:06           ` Tim Prince
2001-07-09  9:10           ` Linus Torvalds
2001-07-09  9:28             ` Marc Espie
2001-07-09  9:58               ` Linus Torvalds
2001-07-09 10:10             ` Paolo Carlini
2001-07-09 14:49         ` Richard Henderson
2001-07-09 15:23           ` Linus Torvalds
2001-07-09 15:55             ` Joern Rennecke
2001-07-09 16:14               ` Linus Torvalds
2001-07-09 16:05             ` Richard Henderson
2001-07-09 16:24               ` Linus Torvalds
2001-07-12  8:41 ` size_t printf warnings and preprocessor Marc Espie
2001-07-12  8:49   ` Andreas Jaeger
2001-07-12  8:52     ` Marc Espie
2001-07-12  8:54       ` Andreas Jaeger
2001-07-12  9:10   ` Joseph S. Myers
  -- strict thread matches above, loose matches on Subject: below --
2001-07-23 19:42 [GCC 3.0] Bad regression, binary size dewar
2001-07-24  9:27 ` Linus Torvalds
2001-07-23  4:46 Jonathan Thornburg
2001-07-23 15:14 ` Linus Torvalds
2001-07-09 10:13 dewar
2001-07-09 10:37 ` Linus Torvalds
2001-07-09  7:50 dewar
2001-07-09  7:18 dewar
2001-07-09  7:22 ` Marc Espie
2001-07-05  8:42 dewar
2001-07-09  0:06 ` Marc Espie
2001-07-09 13:12   ` Gerald Pfeifer
2001-07-09 13:28     ` Neil Booth
2001-07-09 14:13       ` Gerald Pfeifer
2001-07-09 14:36         ` Bobby McNulty
2001-07-09 14:54       ` Justin Guyett
2001-07-09 14:59         ` Phil Edwards
2001-07-09 15:04           ` Marc Espie
2001-07-09 16:43           ` Daniel Berlin
2001-07-05  8:31 dewar
2001-07-05  8:38 ` Marc Espie
1999-09-13 21:45 type based aliasing again N8TM
1999-09-14  4:01 ` Marc Espie
1999-09-14  9:56   ` David Edelsohn
1999-09-14 10:10     ` Richard Earnshaw
1999-09-14 10:31       ` Nick Ing-Simmons
1999-09-14 10:52         ` David Edelsohn
1999-09-14 11:11           ` craig
1999-09-14 14:44             ` David Edelsohn
1999-09-30 18:02               ` David Edelsohn
1999-09-14 15:06             ` David Edelsohn
1999-09-14 17:35               ` Marc Lehmann
1999-09-30 18:02                 ` Marc Lehmann
1999-09-14 23:41               ` craig
1999-09-15  8:28                 ` Marc Lehmann
1999-09-30 18:02                   ` Marc Lehmann
1999-09-15  9:19                 ` David Edelsohn
1999-09-15  9:59                   ` Nick Ing-Simmons
1999-09-15 15:33                     ` David Edelsohn
1999-09-30 18:02                       ` David Edelsohn
1999-09-30 18:02                     ` Nick Ing-Simmons
1999-09-15 10:01                   ` craig
1999-09-30 18:02                     ` craig
1999-09-30 18:02                   ` David Edelsohn
1999-09-30 18:02                 ` craig
1999-09-30 18:02               ` David Edelsohn
1999-09-30 18:02             ` craig
1999-09-14 11:58           ` Gerald Pfeifer
1999-09-30 18:02             ` Gerald Pfeifer
1999-09-30 18:02           ` David Edelsohn
1999-09-14 11:01         ` craig
1999-09-14 11:14           ` craig
1999-09-30 18:02             ` craig
1999-09-14 11:39           ` Mark Mitchell
1999-09-14 14:48             ` Toon Moene
1999-09-14 15:00               ` David Edelsohn
1999-09-14 16:01                 ` Toon Moene
1999-09-14 16:15                   ` David Edelsohn
1999-09-14 16:43                     ` Mark Mitchell
1999-09-30 18:02                       ` Mark Mitchell
1999-09-14 17:39                     ` Marc Lehmann
1999-09-30 18:02                       ` Marc Lehmann
1999-09-30 18:02                     ` David Edelsohn
1999-09-14 16:19                   ` dvv
1999-09-14 17:38                     ` Michael Meissner
1999-09-30 18:02                       ` Michael Meissner
1999-09-30 18:02                     ` Dima Volodin
1999-09-30 18:02                   ` Toon Moene
1999-09-30 18:02                 ` David Edelsohn
1999-09-14 15:08               ` Mark Mitchell
1999-09-30 18:02                 ` Mark Mitchell
1999-09-30 18:02               ` Toon Moene
1999-09-30 18:02             ` Mark Mitchell
1999-09-30 18:02           ` craig
1999-09-14 23:46         ` Geoff Keating
1999-09-15  7:47           ` Nick Ing-Simmons
1999-09-30 18:02             ` Nick Ing-Simmons
1999-09-30 18:02           ` Geoff Keating
1999-09-30 18:02         ` Nick Ing-Simmons
1999-09-30 18:02       ` Richard Earnshaw
1999-09-14 17:22     ` Marc Lehmann
1999-09-30 18:02       ` Marc Lehmann
1999-09-30 18:02     ` David Edelsohn
1999-09-14 17:23   ` Marc Lehmann
1999-09-15  1:59     ` Marc Espie
1999-09-15  8:28       ` Marc Lehmann
1999-09-30 18:02         ` Marc Lehmann
1999-09-30 18:02       ` Marc Espie
1999-09-30 18:02     ` Marc Lehmann
1999-09-15  2:01   ` Jeffrey A Law
1999-09-30 18:02     ` Jeffrey A Law
1999-09-30 18:02   ` Marc Espie
1999-09-30 18:02 ` N8TM

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).