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]
Other format: [Raw text]

Re: gcc 3.4.1 and CPU optimization


Orginal message
> On Wed, Dec 01, 2004 at 06:35:08PM +0100, Zbigniew ?uszpi?ski wrote:
> > Remember that default settings are always overwritten by those 
> > set in command line (by script or user). The aim of this discussion is to 
> > create default gcc configuration which can not be replaced by parameters 
> > executed from commandline.
> 
> I would oppose such an approach in the official gcc, as it makes the
> compiler more difficult to support.  People will then report bugs that we
> can't reproduce, because they are unaware of the settings in a hidden
> configuration file.

This file should be an option for power users. All of its content should be 
commented out by default. The power users would delete comment # signs to 
enable options they need. In such way the rest of gcc users will be safe.

I have new idea about this issue. gcc should have new option: 
-use-current-cpu. This option should have higher priority than other to stop 
optimization chaos. The gcc could detect current processor by looking 
in: /proc/cpuinfo file.
There are some advatanges:
+ old scripts will not be broken because they do not know new option
+ it is easy to support in new scripts
+ the faulty configure processor detection procedure could be removed from 
make scripts
+ it is easy to support in old configure scripts via adding 
CFLAGS="-use-current-cpu" to configure in commandline. Thanks to this gcc 
will silently clean up its commandline parameters by ignoring old 
optimization parameters.
+ it is easier to update gcc processor recognize engine than updating million 
configure scripts laying around Internet.

> > Ali Imran have good idea how to resolve this problem. I probably end up
> > with bash script aliased to gcc which will filter out deprecated
> > options, add mine and pass it to orginal gcc renamed to gcc.orginal.
> 
> This is the best approach; even better would be to avoid renaming gcc,
> and calling your script gcc-zbigniew or something, so that people who
> run it are constantly aware that they are not running the actual gcc.
> After all, you appear to want to either reject or silently discard some
> options, and add other options that the user did not select.
> With proper Makefiles, you can change the compiler just by specifying
> the value of one variable (CC).
> 

The renaming gcc by aliasing it is necessary. Since someone told me 
about ./configure CFLAGS="option" I was manually editing houndreds of config 
lines (many programs were compiled) to have good optimization. If you 
recompile many programs to speed up system a little you will understand what 
I am talking about.
If I setup gcc to run with -march=athlon-xp option it would be good to reject 
or silently discard bad optimizations from scripts like -m386 or 
-mtune=pentium. It is sad that I have to clean chaos made by someone else.

greetings,
Zbigniew


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