comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Re: Modern optimizing compilers
Date: Tue, 22 Aug 2017 04:11:53 +0300
Date: 2017-08-22T04:11:53+03:00	[thread overview]
Message-ID: <ong0d0$1rda$1@gioia.aioe.org> (raw)
In-Reply-To: 30f25a94-fc6d-4663-9405-d4d8601d6681@googlegroups.com

gautier_niouzes@hotmail.com wrote:

> You can compile a package containing a test procedure putting 123 into an
> Integer field of a record (tagged or not) and look at the assembler
> output. With GNAT it's gcc -S -O2 test_pkg.adb NB: the procedure probably
> needs to feed then an "out" parameter to prevent the compiler optimizing
> out completely the assignment with 123.

It seems that your case is wrong.

This procedure has no other choice than to write into the referenced record.

We can however check with code like:

procedure M is
  type T is record
    X: Integer;
  end record;

  I: T;
begin
  I.X := 10;
  Ada.Text_IO.Put_Line(Integer'Image(I.X));
end;

> Gautier
> _____________________________________________________________
> A free online game in Ada: http://pasta.phyrama.com/game.html

-- 
Victor Porton - http://portonvictor.org

  reply	other threads:[~2017-08-22  1:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 20:32 Modern optimizing compilers Victor Porton
2017-08-21 23:19 ` gautier_niouzes
2017-08-22  1:11   ` Victor Porton [this message]
2017-08-22  1:17     ` Victor Porton
2017-08-22  1:20       ` Victor Porton
2017-08-22  7:28         ` gautier_niouzes
replies disabled

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