Re: how to avoid a memset() optimization

"Fergus Henderson" <fjh@cs.mu.OZ.AU>
12 Nov 2002 14:01:36 -0500

          From comp.compilers

Related articles
how to avoid a memset() optimization fwai@rsasecurity.com (Francis Wai) (2002-11-07)
Re: how to avoid a memset() optimization lars@bearnip.com (Lars Duening) (2002-11-08)
Re: how to avoid a memset() optimization alexc@world.std.com (Alex Colvin) (2002-11-08)
Re: how to avoid a memset() optimization fjh@cs.mu.OZ.AU (Fergus Henderson) (2002-11-12)
Re: how to avoid a memset() optimization christian.bau@freeserve.co.uk (Christian Bau) (2002-11-12)
Re: how to avoid a memset() optimization lars@bearnip.com (Lars Duening) (2002-11-12)
Re: how to avoid a memset() optimization cgweav@aol.com (Clayton Weaver) (2002-11-12)
Re: how to avoid a memset() optimization n2102139816.ch@chch.demon.co.uk (Charles Bryant) (2002-11-13)
Re: how to avoid a memset() optimization dobes@dobesland.com (Dobes Vandermeer) (2002-11-13)
Re: how to avoid a memset() optimization fjh@cs.mu.OZ.AU (Fergus Henderson) (2002-11-13)
[8 later articles]
| List of all articles for this month |
From: "Fergus Henderson" <fjh@cs.mu.OZ.AU>
Newsgroups: comp.compilers
Date: 12 Nov 2002 14:01:36 -0500
Organization: Computer Science, University of Melbourne
References: 02-11-030 02-11-036
Keywords: C, optimize
Posted-Date: 12 Nov 2002 14:01:36 EST

"Lars Duening" <lars@bearnip.com> writes:


>> [Declaring the array volatile is the right way to do it. The reason
>> volatile exists is to tell the compiler not to do otherwise valid
>> optimizations. -John]
>
>Which is good news for the C/C++ crowd (at least those with compliant
>compilers), but what about compilers for other languages?
>
>[If they have something like volatile, use it. If not, you're on your
>own. -John]


Most popular languages these days support a C interface, so you may be
able to use that to call an external routine written in C, using volatile,
which can clear out the memory.


Version 1.1 of the MS .NET CLR also provides routines for volatile memory
access in the standard library, for use from languages that don't have
direct support for volatile.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.