Re: [PATCH] Do not discard the constructors of empty structs [PR c++/64527]

2015-04-17 Thread Patrick Palka
On Thu, Apr 16, 2015 at 3:54 PM, Jason Merrill wrote: > OK. Thanks, committed as revision 222176. > > Jason

Re: [PATCH] Do not discard the constructors of empty structs [PR c++/64527]

2015-04-16 Thread Jason Merrill
OK. Jason

Re: [PATCH] Do not discard the constructors of empty structs [PR c++/64527]

2015-04-16 Thread Patrick Palka
On Thu, 16 Apr 2015, Jason Merrill wrote: On 04/15/2015 09:00 PM, Patrick Palka wrote: - if (!cleared || num_nonzero_elements > 0) How about adding || TREE_SIDE_EFFECTS (TREE_OPERAND (*expr_p), 1) to this test rather than removing it entirely? That works too. Does the following patc

Re: [PATCH] Do not discard the constructors of empty structs [PR c++/64527]

2015-04-16 Thread Jason Merrill
On 04/15/2015 09:00 PM, Patrick Palka wrote: - if (!cleared || num_nonzero_elements > 0) How about adding || TREE_SIDE_EFFECTS (TREE_OPERAND (*expr_p), 1) to this test rather than removing it entirely? Jason

[PATCH] Do not discard the constructors of empty structs [PR c++/64527]

2015-04-15 Thread Patrick Palka
gimplify_init_constructor() only attempts to gimplify a CONSTRUCTOR's elts under two conditions: if the object has not been zero-initialized, or if categorize_ctor_elements() detected more than one "nonzero" elt in the CONSTRUCTOR. With the PR's testcase, both of these conditions are false: the gi