comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Semantics of Inline vs non-Inline
Date: 15 Oct 2004 06:50:22 +0100
Date: 2004-10-15T06:50:22+01:00	[thread overview]
Message-ID: <x7vpt3k34yp.fsf@smaug.pushface.org> (raw)
In-Reply-To: 35f054ea.0410140733.5f250e6f@posting.google.com

aschwarz@acm.org (skidmarks) writes:

> My compiler vendor says that the semantics of an inline/non-inline
> function can be different at the discretion of the compiler
> vendor. In particular, if at the point of use of an inline function
> the value of an argument (to the defined subprogram) is in a
> register, then it is acceptable to 'crash' because the address of
> the argument is not known (it's in a register).
> 
> My claim is that the semantics of of an inline and non-inline
> subprogram must be identical, and further, the application writer is
> both unaware and should be unaware of the code generated at the
> point of subprogram use.
> 
> Any idea which view is the correct one?

I can see that those aspects of execution that aren't defined by the
language, or which are erroneous, could be affected by inlining. At
the very least the sequence of instructions is going to be different.

GNAT has occasionally told me that something couldn't be inlined
because of some feature of my code, and I would expect at the least
that this would happen here. (I suspect your code is much cut down, a
simple test here shows no problem -- 3.16a1).

But, the variable only got into the register because the compiler
backend put it there, you would have thought the backend would say
"can I leave this variable into a register? oh no, I see I need
'Address, better spill it to store".

I think your claim sounds 100% right. And even if I'm wrong, the
vendor's view seems less than helpful. The compiler ought to _try_ to
do the Right Thing.

-- 
Simon Wright                               100% Ada, no bugs.



  parent reply	other threads:[~2004-10-15  5:50 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <35f054ea.0410140733.5f250e6f@posting.google.com>
2004-10-14 16:14 ` Semantics of Inline vs non-Inline Wojtek Narczynski
2004-10-14 20:05   ` Arthur Schwarz
2004-10-15 10:24     ` Wojtek Narczynski
2004-10-15 16:32       ` Arthur Schwarz
2004-10-14 17:58 ` Martin Krischik
2004-10-15  0:49   ` Arthur Schwarz
2004-10-15  8:05     ` Martin Krischik
2004-10-15 16:39       ` Arthur Schwarz
2004-10-15 16:40       ` Arthur Schwarz
2004-10-15 16:40       ` Arthur Schwarz
2004-10-15 16:45       ` skidmarks
2004-10-15  3:40 ` Steve
2004-10-15  5:50 ` Simon Wright [this message]
2004-10-15 16:57   ` skidmarks
2004-10-18 17:01 ` skidmarks
2004-10-15  6:18 Christoph Karl Walter Grein
2004-10-15 11:02 ` Wojtek Narczynski
  -- strict thread matches above, loose matches on Subject: below --
2004-10-18  6:29 Christoph Karl Walter Grein
2004-10-20 15:07 ` Wojtek Narczynski
2004-10-21  5:07 Christoph Karl Walter Grein
2004-10-21 10:24 ` Wojtek Narczynski
2004-10-21 11:21 Christoph Karl Walter Grein
2004-10-21 20:57 ` Wojtek Narczynski
2004-10-22  0:46 ` skidmarks
2004-10-22  5:50   ` Simon Wright
2004-10-22 12:57     ` Wojtek Narczynski
replies disabled

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