On 11/17/18 7:16 PM, Bernhard Reutner-Fischer wrote: > Hi > >> I'm sending version, I changed the container to hash_map that should >> provide >> faster look up. >> >> I've been testing the patch right now. > > In find_fortran_preinclude_file() you allocate the filename.
Sure, but that's driver allocation and apparently valgrind is not complaining about the memory allocation. > > diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c > index 55d6dafdb5d..4e500f88174 100644 > --- a/gcc/fortran/scanner.c > +++ b/gcc/fortran/scanner.c > @@ -2428,6 +2428,10 @@ gfc_new_file (void) > { > bool result; > > + if (flag_pre_include != NULL > + && !load_file (flag_pre_include, NULL, false)) > + exit (FATAL_EXIT_CODE); > + > if (gfc_cpp_enabled ()) > { > result = gfc_cpp_preprocess (gfc_source_file); > > > Don't you leak the filename here? This string is in FE, which lives in a option string pool. Martin > I.e. > else free() > > thanks, >