Micro
Micro

Reputation: 785

The compilation of the compiler could affect the compiled programs?

Probably my question sounds weird, but my point is: i have to compile a program using GCC, if i compile GCC from the source i will get a slight edge in terms of performances from a software compiled with the fresh new GCC? What I should expect?

Upvotes: 2

Views: 86

Answers (3)

thiton
thiton

Reputation: 36059

  1. You won't get any faster programs out of a compiler built with optimizing flags. Since a program is the compilers' output, and optimizations don't change the output of a correct program, the programs stay the same.
  2. You might, however, profit from new available options if your distributor ships an incomplete compiler. Look through the GCC manual for any options you want to enable (like certain target architecture variants), and if you can't enable them in your current compiler build, there might be potential in a custom-built compiler. However, it is unlikely that it's worth it.

Upvotes: 5

Brett Hale
Brett Hale

Reputation: 22328

Not unless you're building a newer version of gcc, or enabling cloog, graphite, etc.

Upvotes: 1

zed_0xff
zed_0xff

Reputation: 33227

the performance difference usually is nothing or is negligible.

in a very rare, really very rare cases you can see noticeable difference, but not always performance improvement. degradation is possible too.

Upvotes: 0

Related Questions