[wplug] what is optimized by -march in gcc?

Vanco, Don don.vanco at agilysys.com
Fri May 28 07:44:12 EDT 2004



wplug-bounces+don.vanco=agilysys.com at wplug.org wrote:
> I realized that many packages I compile by the
> "./configure;make;make install" cycle use -march=i586 by default.
> But, lucky me, I do have a Pentium MMX 266 in my machine :) .
> So, I am tempted to type ./configure
> CFLAGS="-march=pentium-mmx". Would that make the application
> foo run faster, or would that just make
> gcc run faster?
> And, given that I have just 64Mb, would there be a memory use penalty?
	While I do not do a great deal of coding, I would say that he
only reason _not_ to compile optimized for a given architecture would be
that you potentially limit the "portability" of the resulting binaries
across other platforms.  Depending on the change (.e.g. going from i386
to i686) the resulting binary will be faster if the given package had
optimizations based on that architecture.  AFAIK there is no "memory use
penalty" if you're referring to the actual compile.
	Perhaps someone that does a bit more hacking can comment
further.

	On a side note, Gentoo is a slick distro that can be set compile
_everything_ at install time, with arch optimizations.  If it weren't
for this fun little bug that annihilated ext2 partitions on the release
I was running (1.3?) I'd still be using it.  Word on the street is that
it's much improved these days.  I have a new laptop coming here at work
and have the base install CD ready to give it another shot. 

> Do you Yahoo!?
	I do not.

Don




More information about the wplug mailing list