This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Proper way to make a one-off multi-file testcase?
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Joern Rennecke <joernr at arc dot com>, Jakub Jelinek <jakub at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 1 Feb 2008 07:46:14 -0500 (EST)
- Subject: Re: Proper way to make a one-off multi-file testcase?
- References: <20080130211814.GB8600@elsdt-razorfish.arc.com> <20080130215125.GD24264@sunsite.mff.cuni.cz> <20080130223029.GC8600@elsdt-razorfish.arc.com> <m3sl0ej18f.fsf@localhost.localdomain>
On Wed, 30 Jan 2008, Ian Lance Taylor wrote:
> One issue here is that in some cases const and pure calls can get
> combined and eliminated even with attribute noinline (unless this
> changed recently). So in addition to attribute noinline, putting an
> asm volatile ("") in the function can help make it non-pure and
> non-const.
(The "volatile" is redundant; an asm without in/out operands is
always volatile.)
That method has consensus as the officially supported method to
prevent the apparent effect of inlining (cases that aren't
inlining, but where you can't tell the difference as a user,
such as const/pure-optimization).
What remains is to document it as such, so we don't have to
re-ask every few weeks.
brgds, H-P