------- Comment #50 from vmakarov at redhat dot com 2009-09-06 13:46 ------- I tried several times to reproduce it without success. It is suspicious that only gnat generated files are different. May be the bug is in gnat specific files.
I found that gnat1 generated by a system compiler (gcc 4.3) gives valgrind warnings. So at least this bug is in ada sources. valgrind /home/cygnus/vmakarov/build/lrs/build-p4/gcc/gnat1 -O2 -g -march=i586 -gtoggle -gnatpg -gnata -nostdinc -I- -I. -Iada -I/home/cygnus/vmakarov/build/lrs/gcc/gcc/ada -I/home/cygnus/vmakarov/build/lrs/gcc/gcc/ada/gcc-interface /home/cygnus/vmakarov/build/lrs/gcc/gcc/ada/lib-xref.adb ==28336== Memcheck, a memory error detector. ==28336== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. ==28336== Using LibVEX rev 1804, a library for dynamic binary translation. ==28336== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. ==28336== Using valgrind-3.3.0, a dynamic binary instrumentation framework. ==28336== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. ==28336== For more details, rerun with: -v ==28336== Lib.Xref.Xrefs.Append Lib.Xref.Xrefs.Append_All Lib.Xref.Xrefs.Decrement_Last Lib.Xref.Xrefs.Free Lib.Xref.Xrefs.Increment_Last Lib.Xref.Xrefs.Init Lib.Xref.Xrefs.Last Lib.Xref.Xrefs.Reallocate Lib.Xref.Xrefs.Release Lib.Xref.Xrefs.Restore Lib.Xref.Xrefs.Save Lib.Xref.Xrefs.Set_Item Lib.Xref.Xrefs.Set_Last Lib.Xref.Xrefs.Tree_Get_Table_Address Lib.Xref.Xrefs.Tree_Read Lib.Xref.Xrefs.Tree_Write Lib.Xref.Xref_Entryip Lib.Xref.Xrefs.Table_Typeip Lib.Xref.Xrefs.Saved_Tableip Lib.Xref.Generate_Definition Lib.Xref.Generate_Operator_Reference Lib.Xref.Generate_Prim_Op_References Lib.Xref.Generate_Reference Lib.Xref.Generate_Reference.Is_On_Lhs Lib.Xref.Generate_Reference.Ok_To_Set_Referenced Lib.Xref.Generate_Reference_To_Formals Lib.Xref.Generate_Reference_To_Generic_Formals Lib.Xref.Initialize Lib.Xref.Output_References Lib.Xref.Output_References.Get_Type_Reference Lib.Xref.Output_References.Output_Import_Export_Info Lib.Xref.Output_References.Handle_Orphan_Type_References.New_Entry Lib.Xref.Output_References.Handle_Orphan_Type_References.B_17.Parent_Op LIB.XREF.OUTPUT_REFERENCES.OUTPUT_REFS.SORTING.SORT LIB.XREF.OUTPUT_REFERENCES.OUTPUT_REFS.SORTING.SORT.SIFT Lib.Xref.Output_References.Output_Refs.Lt Lib.Xref.Output_References.Output_Refs.Move Lib.Xref.Output_References.Output_Refs.Name_Change Lib.Xref.Output_References.Output_Refs.Output_One_Ref.Check_Type_Reference Lib.Xref.Output_References.Output_Refs.Output_One_Ref.Output_Instantiation_Refs Lib.Xref.Output_References.Output_Refs.Output_One_Ref.Output_Overridden_Op Lib.Xref.Output_References.Output_Refs.Output_One_Ref.Write_Level_Info.Is_Private_Record_Component Lib.Xref.Output_References.Output_Refs.Output_One_Ref.Write_Level_Info.Is_Visible_Generic_Entity Lib.Xref==28336== Conditional jump or move depends on uninitialised value(s) ==28336== at 0x82D866C: lib__xref__output_references (lib-xref.adb:1504) ==28336== by 0x82DB89B: lib__writ__write_ali (lib-writ.adb:1235) ==28336== by 0x8440E4C: _ada_gnat1drv (gnat1drv.adb:957) ==28336== by 0x816D606: gnat_parse_file (misc.c:176) ==28336== by 0x86E1D81: toplev_main (toplev.c:1038) ==28336== by 0x84413A1: main (main.c:35) ==28336== ==28336== Conditional jump or move depends on uninitialised value(s) ==28336== at 0x82D8BE5: lib__xref__output_references (lib-xref.adb:1753) ==28336== by 0x82DB89B: lib__writ__write_ali (lib-writ.adb:1235) ==28336== by 0x8440E4C: _ada_gnat1drv (gnat1drv.adb:957) ==28336== by 0x816D606: gnat_parse_file (misc.c:176) ==28336== by 0x86E1D81: toplev_main (toplev.c:1038) ==28336== by 0x84413A1: main (main.c:35) Analyzing compilation unit Performing interprocedural optimizations <visibility> <early_local_cleanups> <summary generate> <cp> <inline> <static-var> <pure-const>Assembling functions: Lib.Xref.Output_References.Output_Refs.Lt LIB.XREF.OUTPUT_REFERENCES.OUTPUT_REFS.SORTING.SORT.SIFT Lib.Xref.Generate_Reference.Is_On_Lhs Lib.Xref.Output_References.Get_Type_Reference {GC 5332k -> 4189k} Lib.Xref.Output_References.Output_Refs.Output_One_Ref.Output_Instantiation_Refs Lib.Xref.Output_References.Output_Refs.Output_One_Ref.Check_Type_Reference Lib.Xref.Xrefs.Decrement_Last Lib.Xref.Xrefs.Free Lib.Xref.Xrefs.Last Lib.Xref.Xrefs.Reallocate Lib.Xref.Xrefs.Init Lib.Xref.Xrefs.Increment_Last Lib.Xref.Output_References.Handle_Orphan_Type_References.New_Entry Lib.Xref.Xrefs.Release Lib.Xref.Xrefs.Restore Lib.Xref.Xrefs.Save Lib.Xref.Xrefs.Set_Last Lib.Xref.Xrefs.Set_Item Lib.Xref.Xrefs.Append Lib.Xref.Xrefs.Append_All Lib.Xref.Xrefs.Tree_Get_Table_Address Lib.Xref.Xrefs.Tree_Read Lib.Xref.Xrefs.Tree_Write Lib.Xref.Xref_Entryip Lib.Xref.Xrefs.Table_Typeip Lib.Xref.Xrefs.Saved_Tableip Lib.Xref.Generate_Definition Lib.Xref.Generate_Reference Lib.Xref.Generate_Operator_Reference Lib.Xref.Generate_Reference_To_Formals Lib.Xref.Generate_Reference_To_Generic_Formals Lib.Xref.Initialize Lib.Xref.Output_References {GC 5486k -> 3997k} Lib.Xref Execution times (seconds) garbage collection : 0.67 ( 1%) usr 0.00 ( 0%) sys 0.69 ( 1%) wall 0 kB ( 0%) ggc ... TOTAL : 115.38 0.61 117.50 8192 kB Extra diagnostic checks enabled; compiler may run slowly. Configure with --enable-checking=release to disable checks. ==28336== ==28336== ERROR SUMMARY: 3700 errors from 2 contexts (suppressed: 17 from 1) ==28336== malloc/free: in use at exit: 13,283,260 bytes in 4,503 blocks. ==28336== malloc/free: 362,569 allocs, 358,066 frees, 157,150,720 bytes allocated. ==28336== For counts of detected errors, rerun with: -v ==28336== searching for pointers to 4,503 not-freed blocks. ==28336== checked 21,383,192 bytes. ==28336== ==28336== LEAK SUMMARY: ==28336== definitely lost: 1,557,317 bytes in 770 blocks. ==28336== possibly lost: 546,634 bytes in 5 blocks. ==28336== still reachable: 11,179,309 bytes in 3,728 blocks. ==28336== suppressed: 0 bytes in 0 blocks. ==28336== Rerun with --leak-check=full to see details of leaked memory. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41241