Hi, I'm seeing some valgrind warnings about illegal reads from addresses if I use VTA. While compiling newlib I intermittently get segfaults in the compiler for the attached testcase , but it seems to go away when I run this through a debugger.
This is with revision r151500. Configuring a compiler with valgrind checks turned on I get the following messages from valgrind for the attached testcase with the following options. These warnings seem to go away if I use -fno-var-tracking. ==29394== Invalid read of size 2 ==29394== at 0x552887: loc_descriptor (dwarf2out.c:11671) ==29394== by 0x552980: loc_descriptor (dwarf2out.c:11688) ==29394== by 0x552A7E: loc_descriptor (dwarf2out.c:11711) ==29394== by 0x5578BB: add_location_or_const_value_attribute (dwarf2out.c:13439) ==29394== by 0x558467: gen_variable_die (dwarf2out.c:15810) ==29394== by 0x559B0D: gen_decl_die (dwarf2out.c:17071) ==29394== by 0x562630: decls_for_scope (dwarf2out.c:16693) ==29394== by 0x55A785: gen_subprogram_die (dwarf2out.c:15533) ==29394== by 0x55975D: gen_decl_die (dwarf2out.c:17004) ==29394== by 0x595375: rest_of_handle_final (final.c:4264) ==29394== by 0x63C323: execute_one_pass (passes.c:1292) ==29394== by 0x63C520: execute_pass_list (passes.c:1341) ==29394== Address 0x5004d08 is 120 bytes inside a block of size 1,608 free'd ==29394== at 0x4A05D82: free (vg_replace_malloc.c:325) ==29394== by 0x4E446E: empty_alloc_pool (alloc-pool.c:210) ==29394== by 0x4E44D8: free_alloc_pool (alloc-pool.c:230) ==29394== by 0x52203E: cselib_finish (cselib.c:2038) ==29394== by 0x7D7E3B: vt_finalize (var-tracking.c:7425) ==29394== by 0x7E420B: variable_tracking_main (var-tracking.c:7475) ==29394== by 0x63C323: execute_one_pass (passes.c:1292) ==29394== by 0x63C520: execute_pass_list (passes.c:1341) ==29394== by 0x63C534: execute_pass_list (passes.c:1342) ==29394== by 0x63C534: execute_pass_list (passes.c:1342) ==29394== by 0x7041B7: tree_rest_of_compilation (tree-optimize.c:390) ==29394== by 0x813A95: cgraph_expand_function (cgraphunit.c:1147) ==29394== ==29394== Invalid read of size 1 ==29394== at 0x5528E3: loc_descriptor (dwarf2out.c:11934) ==29394== by 0x552980: loc_descriptor (dwarf2out.c:11688) ==29394== by 0x552A7E: loc_descriptor (dwarf2out.c:11711) ==29394== by 0x5578BB: add_location_or_const_value_attribute (dwarf2out.c:13439) ==29394== by 0x558467: gen_variable_die (dwarf2out.c:15810) ==29394== by 0x559B0D: gen_decl_die (dwarf2out.c:17071) ==29394== by 0x562630: decls_for_scope (dwarf2out.c:16693) ==29394== by 0x55A785: gen_subprogram_die (dwarf2out.c:15533) ==29394== by 0x55975D: gen_decl_die (dwarf2out.c:17004) ==29394== by 0x595375: rest_of_handle_final (final.c:4264) ==29394== by 0x63C323: execute_one_pass (passes.c:1292) ==29394== by 0x63C520: execute_pass_list (passes.c:1341) ==29394== Address 0x5004d0a is 122 bytes inside a block of size 1,608 free'd ==29394== at 0x4A05D82: free (vg_replace_malloc.c:325) ==29394== by 0x4E446E: empty_alloc_pool (alloc-pool.c:210) ==29394== by 0x4E44D8: free_alloc_pool (alloc-pool.c:230) ==29394== by 0x52203E: cselib_finish (cselib.c:2038) ==29394== by 0x7D7E3B: vt_finalize (var-tracking.c:7425) ==29394== by 0x7E420B: variable_tracking_main (var-tracking.c:7475) ==29394== by 0x63C323: execute_one_pass (passes.c:1292) ==29394== by 0x63C520: execute_pass_list (passes.c:1341) ==29394== by 0x63C534: execute_pass_list (passes.c:1342) ==29394== by 0x63C534: execute_pass_list (passes.c:1342) ==29394== by 0x7041B7: tree_rest_of_compilation (tree-optimize.c:390) ==29394== by 0x813A95: cgraph_expand_function (cgraphunit.c:1147) ==29394== The command line options used to generate these warnings are : -O2 -g -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard and the compiler was configured with --target=arm-none-eabi --with-float-abi=softfp --with-fpu=neon --with-cpu=cortex-a8 --enable-checking=valgrind --with-mpfr=/projects/pl802_weddell/tools/linux_x86_64/ --enable-languages=c --with-valgrind=/arm/tools/gnu/valgrind/3.5.0/rhe5-x86_64/ -- Summary: Valgrind failures / illegal reads with VTA turned on. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ramana at gcc dot gnu dot org GCC build triplet: x86_64-linux-gnu GCC host triplet: x86_64-linux-gnu GCC target triplet: arm-none-eabi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41307