This is the mail archive of the gcc-help@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: strength reduction and other optimizations


Good advice, Ian.  Thanks.  I'm fanatical about readability and
efficiency.  But I normally don't micro-optimize when micro-optimiations
would decrease my code's readability.

Ian Lance Taylor wrote:

Unless your code is performance critical, you should write whatever
code will be easier for people to read and understand.  In the
relatively rare case that the code is performance critical, then you
should certainly do whatever generates the faster assembly code, and
revisit the issue whenever you run the program on a new computer.
 
gcc is able to both optimizations you mention, and it will do them,
when optimizing, when it is beneficial.

________________________________________________________________
"Pro-choice?"  Then click here.
http://cathinsight.com/morality/saying.htm

"Men must look for the peace of Christ in the Kingdom of Christ... When
once men recognize, both in private and in public life, that Christ is
King, society will at last receive the great blessings of real liberty,
well-ordered discipline, peace and harmony."  Pope Pius XI


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