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: Sun, 13 Nov 2016 16:42:37 -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> Date: Sun, 13 Nov 2016 22:42:36 +0000 Message-ID: <878tsn2e8z.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:Xs1AheOsHqJi4hD7HmbSGvkPnLA= MIME-Version: 1.0 Content-Type: text/plain Lines: 25 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-kVzBMzviPSUG1ORT4ZdmqDtHncbSKbFmcfWqjNINOQ76nMAi8JVnGjBCZzp5Q0XWfYPwV6r4S5jx2cC!2eTfXjSCKT6SQ1AlYUMS6ZqxZWzj5bmPu6vhFGfPxBvCO7Nis0ur9wg1rJ1lkdi5Crze 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: 2454 Xref: csiph.com comp.lang.c:96514 supercat@casperkitty.com writes: > While some people may deride the use of C for tasks they think should be done > in assembly language, the behavior of a C program on almost any real-world > platform can be described as a sequence of loads, stores, and computations > which will map very nicely into machine code for that platform, and C fits > better with that mapping than any other language. 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?