On Jun 17, 2011, at 2:13 PM, Eli Friedman wrote:
> On Fri, Jun 17, 2011 at 11:21 AM, Douglas Gregor <[email protected]> wrote:
>> The attached patch fixes the root of the problem: by detecting when the rhs 
>> is something that will build an aggregate piecemeal, we can generate safer 
>> code that creates a temporary for the rhs and then copies it over. In the 
>> common case (rhs builds a full aggregate value in one shot), we still 
>> perform the optimization.
>> 
>> Comments appreciated!
> 
> I'm sort of uncomfortable with the blacklist approach... are you sure
> you're actually catching all the unsafe cases?

I agree;  we should be white-listing expressions that are actually safe
to emit directly like this.  The only cases that come to mind would be
(expressions that produce their value via one of)
  an lvalue-to-rvalue conversion 
  a rvalue member expression
  ???

Alternatively, we could propagate a "result is potentially aliased"
bit in AggValueSlot.

John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to