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 Newsgroups: comp.lang.ada Subject: Optimizing out elaborations Message-ID: <8810141348.AA22416@ti.com> Date: 14 Oct 88 13:33:33 GMT Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: Fred Hosch writes: > It's not clear to me that LRM 11.6(7) permits the compiler to optimize > away the declaration elaboration. If K were a variable subsequently > assigned, the "predefined operation" of assignment "need not be invoked." > I think a CONSTRAINT_ERROR or NUMERIC_ERROR is required to be raised > in this case? Imagine the following program segment: count: integer := 0; function counter return integer; a: constant integer := counter; b: constant integer := counter; c: constant integer := counter; function counter return integer is begin count := count +1; return count; end; ... I sure would expect A and C to get 1 and 3 respectively; even if the compiler optimized away the variable B. Mike Linnig, Texas Instruments