Path: csiph.com!eternal-september.org!feeder.eternal-september.org!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: Mon, 14 Nov 2016 12:42:55 -0600 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: Compiler design in C? References: <23d0f58e-a17c-4ef7-8db6-9cc5b7bcaf04@googlegroups.com> <9e27a17d-aaab-48e1-9139-95114dea0da6@googlegroups.com> <3121b7be-aca1-44b0-9dc9-6b23611bbfba@googlegroups.com> <300e8fda-56cf-476f-9bd7-257791357090@googlegroups.com> <8760nsr02s.fsf@gmail.com> <0dc796fe-911c-4dc0-952a-7b9e3ed54eae@googlegroups.com> <87mvh4kytv.fsf@bsb.me.uk> <7f59dd53-a2fd-4e61-85b9-308790eeab7d@googlegroups.com> <877f87llzn.fsf@bsb.me.uk> <7309d801-64fc-4d2b-961e-1e8b50f11389@googlegroups.com> <878tsn2e8z.fsf@gmail.com> <65a37d5b-1c93-41ad-95f4-321c05397d43@googlegroups.com> <87vavqh6zf.fsf@gmail.com> Date: Mon, 14 Nov 2016 18:42:55 +0000 Message-ID: <874m39ykb4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:ujq21uIUBFhThO/PqivwlxXBEXs= MIME-Version: 1.0 Content-Type: text/plain Lines: 23 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-0u5646GE3C/X6betMvaMa9rLsG2YXkQUPQbUPy9o/b6keKYY/HKxGkqFDvokazaTaJQl5uB4/jSOtqf!h78rCwkRUHeZfHfGtwxrPErA+B9HB+ttKV4VnSjzFuU1Q8glwTHkJ8n2zQ0N9KOqupqm 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: 2688 Xref: csiph.com comp.lang.c:96555 supercat@casperkitty.com writes: > On Monday, November 14, 2016 at 1:10:35 AM UTC-6, gwowen wrote: >> supercat writes: >> >> > On Sunday, November 13, 2016 at 4:42:44 PM UTC-6, gwowen wrote: >> > Since neither x nor y has its address taken, a compiler could easily >> > recognize that there is no possible means by which x can hold anything other >> > than 3, or y can hold anything other than 6, when the printf is executed. >> >> This entirely at odds with your previous description of how variable >> reads / writes should map to loads and stores. > > They should behave *as if* they are being read from and written to memory. I don't understand. How does printf("7\n"); behave as if x=3 and y=4 have been read and written from memory (in a sense not already covered by C's as if rule, which you reject as not being the correct model for optimisation)