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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!skvax1.csc.ti.COM!linnig From: linnig@skvax1.csc.ti.COM (Mike Linnig) Newsgroups: comp.lang.ada Subject: over ambitious optimizers Message-ID: <8806241657.AA23329@ti.com> Date: 24 Jun 88 16:48:42 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: Folks, I compiled the following procedure and discovered that the validated compiler I was using had optimized away the first assignment of I. I was really testing something else, but should it have deleted that assignemnt? I can imagine that the function SOMEINT actually used the value of I in it's calculation (it would be in the scope of I). Is this an over ambitious optimizer? Mike Linnig, Texas Instruments ---------------------------------------------------------------------- PROCEDURE leftside(i: IN OUT integer) IS TYPE myarray IS ARRAY(integer RANGE 1..15) OF integer; anarray: myarray; FUNCTION someint RETURN integer IS SEPARATE; BEGIN I := 5; -- OPTIMIZED AWAY ! anarray(someint) := 3; i := 7; END;