This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, fortran, committed] Free memory allocated for data statements


Hello,

This patch fixes two valgrind warnings shown with the testcase:

!!!!!!!
  data i /0/
  print *, i
  end
!!!!!!!


==59757== 8 bytes in 1 blocks are definitely lost in loss record 4 of 368
==59757== at 0x25A67B: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==59757== by 0x1C523B8: __gmp_default_allocate (in /usr/local/lib/libgmp.so.10)
==59757== by 0x1C60607: __gmpz_init (in /usr/local/lib/libgmp.so.10)
==59757== by 0x4A2737: top_val_list.isra.9 (decl.c:428)
==59757== by 0x4A2958: gfc_match_data (decl.c:541)
==59757== by 0x4E7C35: match_word (parse.c:65)
==59757== by 0x4E8936: decode_statement (parse.c:361)
==59757== by 0x4E98C4: next_statement (parse.c:727)
==59757== by 0x4ED1D8: gfc_parse_file (parse.c:4311)
==59757== by 0x522EA7: gfc_be_parse_file (f95-lang.c:241)
==59757== by 0x80F6BD: toplev_main (toplev.c:945)
==59757== by 0x48E17B: (below main) (in /usr/home/mik/gcc46/build/gcc/f951)
==59757==
==59757== 8 bytes in 1 blocks are definitely lost in loss record 5 of 368
==59757== at 0x25A67B: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==59757== by 0x1C523B8: __gmp_default_allocate (in /usr/local/lib/libgmp.so.10)
==59757== by 0x1C61937: __gmpz_init_set_si (in /usr/local/lib/libgmp.so.10)
==59757== by 0x49F809: gfc_assign_data_value (data.c:210)
==59757== by 0x4FBE31: traverse_data_var (resolve.c:12131)
==59757== by 0x4FEEF8: resolve_types (resolve.c:12315)
==59757== by 0x4F895F: gfc_resolve (resolve.c:13085)
==59757== by 0x4ED7C3: gfc_parse_file (parse.c:4211)
==59757== by 0x522EA7: gfc_be_parse_file (f95-lang.c:241)
==59757== by 0x80F6BD: toplev_main (toplev.c:945)
==59757== by 0x48E17B: (below main) (in /usr/home/mik/gcc46/build/gcc/f951)



Committed as obvious after regression testing.


Mikael

Attachment: r162649.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]