From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,270d47706116d3c X-Google-Attributes: gid103376,public From: l117593@cliffy.lfwc.lockheed.com (Cordes MJ) Subject: Re: Can compilers do this? Date: 1996/02/23 Message-ID: <4gl4lq$7aa@cliffy.lfwc.lockheed.com>#1/1 X-Deja-AN: 140843793 references: <4gjd6g$mfq@newsbf02.news.aol.com> organization: Lockheed Martin Tactical Aircraft Systems newsgroups: comp.lang.ada Date: 1996-02-23T00:00:00+00:00 List-Id: BWBurnsed (bwburnsed@aol.com) wrote: : Also, suppose Y and X are floating point variables, and M and B are : CONSTANT floating point variables (not named numbers) initialized to : 1.0 and 0.0 respectively. If one writes : Y := M * X + B ; : can (and will) any compiler reduce this to : Y := X ; I can't say that all compilers will perform this optimization, but the Tartan VMS/1750 Ada compiler does (at its standard optimization level). We have seen cases where some compilers will perform the optimization if the statement is written as: Y := (M * X) + B; but it will not perform the optimization when written as you originally posted. -- --------------------------------------------------------------------- Michael J Cordes Phone: (817) 935-3823 Fax: (817) 935-3800 EMail: CordesMJ@lfwc.lockheed.com ---------------------------------------------------------------------