From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: "Douglas A. Gwyn" Message-ID: <3DD1DDD5.8090304@null.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit References: <01974d0bd36314a7c8172b6eca15effe@plan9.bell-labs.com> Subject: Re: [9fans] how to avoid a memset() optimization Date: Wed, 13 Nov 2002 10:15:43 +0000 Topicbox-Message-UUID: 1ca7497e-eacb-11e9-9e20-41e7f4b1d025 Russ Cox wrote: > I disagree. It hurts readability and clarity, all > to avoid a bug in gcc. If I asked it to zero the > memory, then, damn it!, zero the memory. It's not a bug, it's an allowed optimization (in the absence of volatile qualification). The question is where to draw the line for degree of optimization, and the volatile qualifier was invented precisely to draw the line at actually performing the coded accesses to the variable whether or not the result is further used in the program.