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: Question About New Option '-fipa-sra': How Does It Work?


On Tue, Apr 13, 2010 at 17:00, Kevin P. Fleming <kpfleming@digium.com> wrote:
> Tom Browder wrote:
>> I see the new -fipa-sra option for gcc 4.5 and its explanation and
>> wonder how replacing an argument passed by reference with an argument
>> passed by value is an optimization (I assume something magic is going
>> on behind the scenes).
>
> Well... a pointer to an int on an x86-64 platform is 8 bytes on the
> stack instead of 4, and slower access to the contents of the int. If the
> int is never modified in the called function, passing a copy of the int
> on the stack instead is clearly a win.

Thanks, Kevin, I was asleep--I immediately thought of structures and
containers--duh!

(But perhaps the text could be more explicitly worded for us dense heads.)

Regards,

-Tom


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