comp.lang.ada
 help / color / mirror / Atom feed
From: Arthur Schwarz <aschwarz@acm.org>
Subject: Re: Semantics of Inline vs non-Inline
Date: Thu, 14 Oct 2004 13:05:47 -0700
Date: 2004-10-14T13:05:47-07:00	[thread overview]
Message-ID: <w_Abd.3$k01.0@dfw-service2.ext.ray.com> (raw)
In-Reply-To: <pan.2004.10.14.16.14.15.825891@power.com.pl>

Wojtek Narczynski wrote:
> Hello,
> 
> 
>>Any idea which view is the correct one?
> 
> 
> I would say - neither. Optimizations (pragma inline is supposed to be one)
> sometimes do change the behavior of the program. For example on x86 you
> can get different floating point results, depending on the optimization
> level, and that's legal and logical.
> 
> But in this case, if the compiler is unable to do both (pragma Inline, and
> for X'Address) it should tell you about it, not fail at runtime.
> 
> I think that using Unchecked_Conversion, instead of (ab)using 'Address rep
> clause, will fix the problem.

   No abuse. 'Address is legal Ada. A novel or unexpected use does not
   mean that it 'abuses' the language. The current use allows the
   equivalent of a C/++ 'union'. Other C.L.A. communication shows this
   to be both a viable use and (to some) a good one.

> 
> Oh, and why is Push a function?

   Why not? (Putting on my Pontifical Hat), I am the designer and Lord
   over my demesne. The historical root of this usage is from SLIP as
   described in
      PROGRAMMING SYSTEMS AND LANGUAGES
      McGraw-Hill Book Company
      Copyright 1967
      Library of Congress # 66-29754
      Author: Rosen

   Although written in FORTRAN II and somewhat dated, the core design
   is valid and provide an extensive set of tools to manipulate general
   lists. Part of the design is the use of return values to allow an
   application to nest function calls to generate a single useful result,
   as in 'Cell := Push(Push(datum));'. This format of algebraic
   is not much in use (for quite good reason) but as both legacy and
   currency it still deserves a place.
> 
> Finally, inlining is often counter-productive, because it causes code size
> explosion, which in turn causes CPU cache hit ratio degradation.

   In general this is accurate. The use of inlines in my case is
   carefully designed. It is expected that the inline subprograms
   will generate not code (will be optimized away) in the best
   case, and in the worst case, the overhead in code for subprogram
   entry and exit will be greater than or equal to the code within
   the subprogram. The performance should be more attractive.
> 
> 
> Regards,
> Wojtek

   The issue then seems to be that some of the semantics of an inline
   function can change, most particularly in the use of atomic numbers.
   But what else is affected?

Thank you.


art



  reply	other threads:[~2004-10-14 20:05 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 [this message]
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
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