[PATCH] Fix IMPLICIT CHARACTER handling (PR fortran/46884)

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Dec 11 11:46:00 GMT 2010


On Fri, Dec 10, 2010 at 08:45:23PM +0100, Jakub Jelinek wrote:
> 
> On the attached testcase f951 ICEs under valgrind (and on a larger
> testcase can ICE even without it), because a charlen is freed, eventhough
> it is actually referenced.
> 
> The problem is with IMPLICIT charlen, gfc_new_charlen with non-NULL old_cl
> generates a copy of a charlen, which is then attached to an implicitly
> typed symbol, but if reject_statement is called afterwards, the charlen
> copy is freed, eventhough a pointer to it remains in the data structures.
> 
> Fixed by making sure we never free in reject_statements gfc_new_charlen
> created structures if old_cl was non-NULL.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 

OK.

-- 
Steve



More information about the Gcc-patches mailing list