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


Zbigniew ÅuszpiÅski <zbiggy@o2.pl> writes:

> I compile many programs from sources. A lot of them have optimizations like 
> -m386, -mcpu=486, -mtune=i686, -march=i686 or other.
> I use AMD AthlonXP 2500+. Everytime I compile program first do ./configure 
> CFLAGS="-march=athlon-xp". Could you tell me which one optimization will be 
> used? These hardcoded into configure script or this one provided by me with 
> CFLAGS parameter ?

The one which is used when the compiler is run.  In typical cases this
will be the one specified as the CFLAGS parameter when you run
configure, but you should check the actual compilation lines to be
sure.

> What will happen when gcc will get -march=i586 from script and 
> -march=athlon-xp from me?

gcc will use the one which appears last on the gcc command line.

> Which optimization will be used when some of them are placed together? e.g. 
> -mtune=pentium -march=athlon-xp.

In a case like that both will be used.  The -march option controls the
generated instruction set.  The -mtune option controls the tuning,
which affects instruction selection (among supported instructions) and
scheduling.

When two -mtune or -march options are used, the one which appears last
on the command line takes precedence.

Ian


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