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: RFH: TARGET_EXPRs and value-initialization


Mark Mitchell wrote:
Jason Merrill wrote:
What if you make these semantics a flag on AGGR_INIT_EXPR so you can
delay expressing the actual semantics until simplify_aggr_init_expr?  By
that time I believe we have the actual object being initialized.

Thanks for the help!


That might work...  We still have a TARGET_EXPR, though, so aren't we
still in the situation where the VAR_DECL in the TARGET_EXPR might get
eliminated in favor of the thing initialized by the TARGET_EXPR?

That's the normal behavior of TARGET_EXPR. We only run into trouble if things pull out the VAR_DECL and then use it in situations where we're using the TARGET_EXPR as an initializer for another object.


Also, while we're here, what's the idea with AGGR_INIT_EXPR?  Was this
to keep the semantics in the front-end more C++-ish, or is there an
optimization benefit, or what?

I don't know what Tiemann's original rationale was for it.
It seems helpful for this sort of situation, where we want to defer actually building up the code to manipulate the object until we actually know which object it is we're dealing with.


Jason


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