https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97345

--- Comment #4 from anlauf at gcc dot gnu.org ---
(In reply to kargl from comment #3)
> (In reply to anlauf from comment #2)
> > +
> > +         mpz_clear (do_start);
> > +         mpz_clear (do_end);
> > +         mpz_clear (do_step);
> >         }
> 
> Harald, when I was looking at this PR, I came to the conclusion that only
> do_step needs to be cleared.  I think the do_start and do_end get hooked
> into an iterator, but don't remember the details.  I got sidetracked on the
> the broken valgrind utilities I have on FreeBSD.

The above is almost correct; the clearing of do_start and do_end does need to
be protected by if (have_do_...).  Otherwise regtesting goes sideways... :-O

> I don't think a test case is needed if you use valgrind to verify that the
> memory leaks are gone.  Sure, there are enough do-loop tests already present
> in the testsuite that will fail if the patch goes left.

Indeed!

Reply via email to