Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!ut-ngp!infotel!pollux!bobkat!m5d From: m5d@bobkat.UUCP (Mike McNally ) Newsgroups: comp.lang.c Subject: Re: C and overflow anomolies Message-ID: <881@bobkat.UUCP> Date: Thu, 16-Apr-87 09:09:33 EST Article-I.D.: bobkat.881 Posted: Thu Apr 16 09:09:33 1987 Date-Received: Sun, 19-Apr-87 10:27:57 EST References: <15958@sun.uucp> <5716@brl-smoke.ARPA> Reply-To: m5d@bobkat.UUCP (Mike McNally (Man Insane)) Distribution: world Organization: Digital Lynx, Inc; Dallas, TX Lines: 24 In article <827@xanth.UUCP> kent@xanth.UUCP (Kent Paul Dolan) writes: > . . .If I wrote (all "float" variables): > temp = a - b; > d = temp + c; > in a piece of existing code to avoid the above overflow; the > compiler writer is now free to elide temp from the code, then go > back and rearrange to achieve: > d = (a + c) - b; > >UUCP : kent@xanth.UUCP or ...{sun,cbosgd,harvard}!xanth!kent Not a C compiler writer. A C compiler (as I know it; I suppose my complete ignorance of ANSI C may show here) is not supposed to do any non-expression-local optimizations, not even basic block type stuff. Thus while a Pascal compiler may do such work, or for that matter an optimizing FORTRAN compiler, no C compiler will. -- Mike McNally, mercifully employed at Digital Lynx --- Where Plano Road the Mighty Flood of Forest Lane doth meet, And Garland fair, whose perfumed air flows soft about my feet... uucp: {texsun,killer,infotel}!pollux!bobkat!m5d (214) 238-7474