comp.lang.ada
 help / color / mirror / Atom feed
* over ambitious optimizers
@ 1988-06-24 16:48 Mike Linnig
  1988-06-24 21:22 ` Robert Firth
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Linnig @ 1988-06-24 16:48 UTC (permalink / raw)


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; 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1988-06-24 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1988-06-24 16:48 over ambitious optimizers Mike Linnig
1988-06-24 21:22 ` Robert Firth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox