Date: Sun, 14 Feb 1999 13:08:25 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Paul Derbyshire cc: djgpp AT delorie DOT com Subject: Re: Code gen question In-Reply-To: <3.0.6.32.19990212180551.00841100@pop.netaddress.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Fri, 12 Feb 1999, Paul Derbyshire wrote: > If so, this leads me to ask: under what circumstances will the compiler be > smart enough to detect that an inline function passed an argument of a > builtin type doesn't modify it and avoid making an unnecessary copy? From the GCC docs, it seems that declaring the function with __attribute__((const)) will tell the compiler what you want, so you won't need to rely on the optimizer being smart enough. I didn't actually try to see what that does in the special case you are describing. It's probably easy enough to use -S and look at the assembly code it generates.