delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/03/19:58:01

Date: Wed, 3 Dec 1997 16:56:02 -0800 (PST)
Message-Id: <199712040056.QAA21360@adit.ap.net>
Mime-Version: 1.0
To: Vik Heyndrickx <Vik DOT Heyndrickx AT rug DOT ac DOT be>, djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Pointer to ... and a question

At 03:07  12/3/1997 +0100, Vik Heyndrickx wrote:
>Ruiter de M wrote:
>> Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote:
>> : Of course, it's documented.  Here's a fragment from gcc's Info docs:
>> :   `-O3'
>> :        Optimize yet more.  `-O3' turns on all optimizations specified by
>> :        `-O2' and also turns on the `inline-functions' option.
>
>> Yes, I knew this. But it doesn't say it is the *only* difference, does
>> it? It explains that -O3 turns on all optimizations specified by -O2,
>> and that it also turns on the -finline-functions option, but it might
>> not be the only difference. 
>
>Aaargh... you're right of course.
>
>> Or am I being too suspicious?
>
>Probably.
>
>> I guess we have to look at the sources to be sure.
>
>That'll be the only way to be sure. Although I don't think there will be
>an optimizer feature that won't be enabled by -O2. Imagine. Suppose
>there was one, the only reason not to imply this with -O2 would be
>because it would change code generation significantly (like
>-finline-functions), so it would be an important feature. So it would be
>mentioned explicitely with "-O3".
I did look at the sources. It's quite clear, around line 3375 of toplev.c.
`-O1' and greater turns on:
  defer-pop
  thread-jumps
  delayed-branch, on machines with "delay slots" (not the 386)
  omit-frame-pointer, on machines that can debug without one (not the 386)
`-O2' and greater adds these:
  cse-follow-jumps
  cse-skip-blocks
  expensive-optimizations
  strength-reduce
  rerun-cse-after-loop
  caller-saves
  force-mem
  schedule-insns              \
  schedule-insns-after-reload / On machines where scheduling is important
(not 386)
`-O3' turns on all of the above, plus:
  inline-functions

All other options must be turned on or off explicitly.
There is also a means for a particular configuration file to enable other
optimizations of its own based on the level selected, but the 386 does not
use it.

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019