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: optimisation question


Remy X.O. Martin wrote:

As far as I remember, I have been taught (like 15 years ago) that writing a=b=c can be better than a=c; b=c; because the compiler could more easily use values in registers.

That's nonsense for any reasonable compiler. This is less like advice on general programming than advice on getting around a bug or complete lack of optimization competence on some particular compiler. I suppose if you had a compiler so stupid as to load c twice in the second case, then the advice would make sense.


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