Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 May 1995 14:32:10 +0300
From:      Tatu Ylonen <ylo@cs.hut.fi>
To:        davidg@freefall.cdrom.com
Cc:        freebsd-bugs@freefall.cdrom.com
Subject:   Re: Changed information for PR i386/395
Message-ID:  <199505221132.OAA18301@shadows.cs.hut.fi>
In-Reply-To: <199505220956.CAA19666@freefall.cdrom.com> (davidg@freefall.cdrom.com)

next in thread | previous in thread | raw e-mail | index | archive | help
> Bruce says that gcc's behavior for inlined functions isn't any
> different than it is for real functions WRT caching of variables
> or intermediates...and an analysis of the generated code seems
> to confirm this. It appears to be a non-problem with the current
> gcc.

Well, code like

   ... some code using variable/expression foo ...
   x = spl*();
   ... more code using variable/expression foo ...

does not recompute foo if spl* is an inline function, and does recompute
it if it is not (because then the function might have unknown
side-effects changing foo).

While I am not sure if spl functions are really used in a way that
this would cause problems, I think it would be much safer to eliminate
this possibility of erroneus (or at least very unexpected) code.  The
problem does not appear to be as severe with current compilers and
standardized semantics as I thought, but in my opinion there still is
a problem.  There is a simple way to play safe; I wouldn't consider
the current code that safe.

    Tatu Ylonen <ylo@cs.hut.fi>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199505221132.OAA18301>