Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hplsla!jima From: jima@hplsla.HP.COM (Jim Adcock) Newsgroups: comp.lang.c++ Subject: Re: address of virtual function (revisited) Message-ID: <6590124@hplsla.HP.COM> Date: 12 May 89 00:11:48 GMT References: <904@garya.Solbourne.COM> Organization: HP Lake Stevens, WA Lines: 35 And while I'm asking for some C++ optimizations, is it possible that we will ever see a compiler that doesn't make gratuitous use of the & operator in the C code it generates? Code fragments like: (& __1glop) -> __gloop instead of: __1glop . __gloop And: (( __1thisglop = __1thatglop ) , & __1thisglop ) ; Instead of: ( __1thisglop = __1thatglop ) ; guarantees (in the optimizing C compilers that I know of) that the structures whose address is taken actually exists and resides in memory. Whereas, without the & operator, the structures [if small] may reside in registers, and maybe only those fields of the "structure" that are actually used. Also & __1glop, where neither & __1glop nor __1glop ever actually get used, still causes space on the stack for __1glop to be allocated. While one might claim that optimizing C compilers shouldn't interpret &something to mean that something has to be -- and be in memory, this has been the traditional interpretation of & in C. Seems like C++ should be able to be smart enough to avoid gratuitous & operators, and comma expressions whose return values are clearly not used.