Path: csiph.com!weretis.net!feeder4.news.weretis.net!news.unit0.net!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!buffer2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Tue, 09 May 2017 12:30:46 -0500 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: gcc failure (optimised/non-optimised) References: <0ebb51af-956a-4f98-a441-8ab5004d7427@googlegroups.com> <661a92b8-5aad-4b52-b9c4-484556cf4ac7@googlegroups.com> <87shkjq2qs.fsf@gmail.com> <966b8240-6c88-4a9a-83aa-004646558fca@googlegroups.com> <12ffc80c-0471-43f5-9376-5732bae2ed37@googlegroups.com> Date: Tue, 09 May 2017 18:30:46 +0100 Message-ID: <8760hadjjt.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:4tuvOIrvOvrDIPWaLCCFBRi9Mxs= MIME-Version: 1.0 Content-Type: text/plain Lines: 20 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-cZNLrGQlAI9GmIUmYYgU4E3Lz7LYY7EC/41lRNWxSdv37yWmPPN/Pkzhrhkvnu8GMO19Ql+/rImJuIC!Ezoid/3XyZ5iPzblU2zfR4HT0mpa1kEQGH8yuhEYtI0OVFXhRrD9EhdKIxw78Ayj60ETtT0= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2897 Xref: csiph.com comp.lang.c:109608 David Brown writes: > On 08/05/17 18:16, supercat@casperkitty.com wrote: >> On Monday, May 8, 2017 at 9:21:09 AM UTC-5, David Brown wrote: >>> "some_value" is not volatile, and the compiler can see it is never >>> changed. Why should it reload it? Is the compiler to guess what you >>> meant to write? I suppose /I/ should have been able to guess what you >>> meant, but I often find it hard with your examples. >> >> On many systems, data is read or written by giving some outside process the >> address if the data and performing a write to a volatile location to trigger >> that process. It is not unusual for the act of writing to a volatile location >> to affect other aspects of system state. > > Yes, it is unusual. The code is wrong - it is incorrect C. Maybe you > are used to writing such code, but /I/ certainly am not. Now we get to the nub. Supercat has been writing that incorrect code for decades, and it used to kind-of-mostly-work and he is /pissed/ that everyone else refuses to be constrained by his ingrained misconceptions.