On Wed, May 16, 2018 at 6:35 AM, Martin Jambor <mjam...@suse.cz> wrote: > On Tue, May 15 2018, Jason Merrill wrote: >> In C++11 and up, the implicitly-declared copy constructor and >> assignment operator are deprecated if one of them, or the destructor, >> is user-provided. Implementing that in G++ turned up a few dodgy uses >> in the compiler. >> >> In general it's unsafe to copy an ipa_edge_args, because if one of the >> pointers is non-null you get two copies of a vec pointer, and when one >> of the objects is destroyed it frees the vec and leaves the other >> object pointing to freed memory. This specific example is safe >> because it only copies from an object with null pointers, but it would >> be better to avoid the copy. OK for trunk? > > I have had a look and found out that the function in question > (ipa_free_edge_args_substructures) has no uses, apparently I forgot to > remove it when I did the conversion of jump functions to be stored in > call graph edge summaries. So thanks lot for spotting this but I'd > prefer the following (compiled but untested) patch: > > Martin > > > 2018-05-16 Martin Jambor <mjam...@suse.cz> > > * ipa-prop.c (ipa_free_all_edge_args): Remove. > * ipa-prop.h (ipa_free_all_edge_args): Likewise.
That works for me, too. Jason