Path: csiph.com!feeder.erje.net!1.eu.feeder.erje.net!news.roellig-ltd.de!open-news-network.org!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!buffer1.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Mon, 14 Nov 2016 01:08:21 -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> <6967f10d-555c-55ca-a5c8-9f2ca24a7446@verizon.net> Date: Mon, 14 Nov 2016 07:08:21 +0000 Message-ID: <87zil2h72y.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:q7H2f3KVoSv3m4UG/vww7NOpjOY= MIME-Version: 1.0 Content-Type: text/plain Lines: 25 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-aR7ggxgsBgkZXpE6TberZVO6stvN/OLjKJni/T3Bg6dJEKUZLRf+obJGEnqPBGbfN/oD5jaSMzvCBi/!C7hw7Ig6/UDIxUU9TJ888PNcI+zzaOKMIXurH2NO8E4SHpO3OBHaIA4kabuF6OlPRvGu 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: 2350 Xref: csiph.com comp.lang.c:96527 "James R. Kuyper" writes: > On 11/13/2016 05:42 PM, Gareth Owen wrote: > ... >> Under your translating compiler, should the following two programs >> compile to different assembler? >> >> int main() >> { >> int x = 3; >> int y = 6; >> printf("%d\n",x+y); >> } >> >> int main() >> { >> puts("7"); >> } >> >> Is the former obliged to store, load and then add x and y? > > Was that 7 supposed to be a 9? If not, I don't quite see the point of > the question. No, the 6 was supposed to be a 4