This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ast-optimizer-branch]: Simplify STMT_EXPR's


On Thu, 2 May 2002, Richard Henderson wrote:

> On Thu, May 02, 2002 at 03:12:52PM -0400, Daniel Berlin wrote:
> > > > a
> > > > b = ({<.....> <value>})
> > > > 
> > > > becomes
> > > > 
> > > > a
> > > > {<....> <new temporary> = <value>}
> > > > b = <new temporary>
> 
> Doesn't this mean we have to come up with sensible semantics for
> C++ types with destructors here, wrt lifetime ot temporaries?

No, we're ignoring C++ for now. This is C simplification.
For C++, we'll have to turn it into

a
{
<new temporary declaration>
	{
		<...>	
		<new temporary> = <value>
	}
b = <new temporary>
}

So that the temporary died in the right place (right now, the temporaries 
are function local).

Or something.

--Dan




> 
> 
> r~
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]