Topic: Named object elimination


Author: sdm@cs.brown.edu (Scott Meyers)
Date: Wed, 17 Mar 1993 21:06:13 GMT
Raw View
We all know that someplace in the ARM it prohibits the compiler from
eliminating named objects, even if they don't appear to be used.  My
question is this: in what section is this prohibition?  I've scoured the
ARM, and I just can't find it.

Thanks,

Scott
--

-------------------------------------------------------------------------------
What do you say to a convicted felon in Providence?  "Hello, Mr. Mayor."




Author: vinoski@apollo.hp.com (Steve Vinoski)
Date: Thu, 18 Mar 1993 01:01:24 GMT
Raw View
In article <1993Mar17.210613.25264@cs.brown.edu> sdm@cs.brown.edu (Scott Meyers) writes:
>We all know that someplace in the ARM it prohibits the compiler from
>eliminating named objects, even if they don't appear to be used.  My
>question is this: in what section is this prohibition?  I've scoured the
>ARM, and I just can't find it.

Section 3.5, page 22.

--steve

Steve Vinoski  (508)436-5904   vinoski@apollo.hp.com
Distributed Object Computing Program
Hewlett-Packard, Chelmsford, MA 01824       These are my opinions.




Author: jbuck@forney.berkeley.edu (Joe Buck)
Date: 18 Mar 1993 01:18:56 GMT
Raw View
In article <1993Mar17.210613.25264@cs.brown.edu> sdm@cs.brown.edu (Scott Meyers) writes:
>>We all know that someplace in the ARM it prohibits the compiler from
>>eliminating named objects, even if they don't appear to be used.  My
>>question is this: in what section is this prohibition?  I've scoured the
>>ARM, and I just can't find it.

In article <C4286C.3G7@apollo.hp.com> vinoski@apollo.hp.com (Steve
Vinoski) writes:
>Section 3.5, page 22.

Note that the prohibition applies only to "a local named object with
a constructor or destructor with side effects" which may not be eliminated
"even if it appears to be unused".  The compiler is free to eliminate
other unused named objects.  If the constructor or destructor is not
inline, then as a rule the compiler cannot tell whether there are side
effects or not so it cannot eliminate the object.



--
Joe Buck jbuck@ohm.berkeley.edu




Author: hansen@peca.cs.umn.edu (David Hansen)
Date: 18 Mar 93 03:08:18 GMT
Raw View
In article <1o8im0$sp3@agate.berkeley.edu>, jbuck@forney.berkeley.edu (Joe Buck) writes:
[...]
|>
|> Note that the prohibition applies only to "a local named object with
                                                ^^^^^
|> a constructor or destructor with side effects" which may not be eliminated
|> "even if it appears to be unused".  The compiler is free to eliminate
|> other unused named objects.  If the constructor or destructor is not
|> inline, then as a rule the compiler cannot tell whether there are side
|> effects or not so it cannot eliminate the object.
|>

A little further down it also states, "Similarly, a global object with a
with a constructor or a destructor with side effects may not be eliminated..."

Just a minor clarification (the first quote took me by surprise :).

     -=Dave