[C++ PATCH] Fix PR 55418

Paolo Carlini paolo.carlini@oracle.com
Thu Nov 22 16:03:00 GMT 2012


Hi,

On 11/22/2012 04:06 PM, Jakub Jelinek wrote:
> On Thu, Nov 22, 2012 at 02:28:18PM +0100, Paolo Carlini wrote:
>> On 11/22/2012 01:06 PM, Markus Trippelsdorf wrote:
>>> The fix is trivial. I would appreciate if someone could commit this.
>> I agree it qualifies as obvious and I mean to commit the patch on
>> your behalf before the end of the day if nobody objects. To be
>> super-safe, I guess I will also run the testsuite with the current
>> code and trivial_p initialized to true at the beginning of the
>> function.
> I think trivial_p used to be uninitialized only for deleted_p functions,
> not sure if those are considered trivial or not (and whether it matters)...
I think that the Valgrind complain is benign and, by the way, I just run 
the testsuite with current code + trivial_p initialized to true with no 
regressions. In detail what is happening is that, as you say, in the 
special case of deleted_p true and lambdas, we return from 
synthesized_method_walk and trivial_p is still uninitialized. Then we have:

   if (!trivial_p && type_has_trivial_fn (type, kind))
     type_set_nontrivial_flag (type, kind);

which, if trivial_p is is still uninitialized may not do its job of 
forcing nontrivial set in type: I don't think this is a serious problem 
for lambdas (in any case, when code elsewhere detects deleted shouldn't 
bother anyway of checking triviality; testsuite passes with trivial_p 
initialized to true too), but Markus (and me ;) proposes anyway to 
initialize trivial_p to false, thus we should be fine (way below 
trivial_p is used again but only when deleted_p is false).

Paolo.



More information about the Gcc-patches mailing list