public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/56532] New: valgrind errors with -flto
@ 2013-03-05 10:39 jakub at gcc dot gnu.org
  2022-01-02  4:30 ` [Bug lto/56532] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-03-05 10:39 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56532

             Bug #: 56532
           Summary: valgrind errors with -flto
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org


valgrind --leak-check=full --track-origins=yes --db-attach=yes ./cc1plus
pr46984.C -O -fipa-cp -fno-early-inlining -flto -quiet
gives:
==5852== Conditional jump or move depends on uninitialised value(s)
==5852==    at 0x1205C84: bp_pack_var_len_unsigned(bitpack_d*, unsigned long)
(data-streamer.c:36)
==5852==    by 0xB2144D: lto_output_edge(lto_simple_output_block*,
cgraph_edge*, lto_symtab_encoder_d*) (lto-cgraph.c:277)
==5852==    by 0xB2285F: output_outgoing_cgraph_edges(cgraph_edge*,
lto_simple_output_block*, lto_symtab_encoder_d*) (lto-cgraph.c:651)
==5852==    by 0xB22F9E: output_symtab() (lto-cgraph.c:840)
==5852==    by 0xB2DCD1: lto_output() (lto-streamer-out.c:1000)
==5852==    by 0xB730F7: ipa_write_summaries_2(opt_pass*, lto_out_decl_state*)
(passes.c:2408)
==5852==    by 0xB731E6: ipa_write_summaries_1(lto_symtab_encoder_d*)
(passes.c:2438)
==5852==    by 0xB733B6: ipa_write_summaries() (passes.c:2492)
==5852==    by 0x893292: ipa_passes() (cgraphunit.c:1905)
==5852==    by 0x8936B7: compile() (cgraphunit.c:1991)
==5852==    by 0x8939B7: finalize_compilation_unit() (cgraphunit.c:2119)
==5852==    by 0x647071: cp_write_global_declarations() (decl2.c:4318)
==5852==  Uninitialised value was created by a client request
==5852==    at 0x7F654A: ggc_internal_alloc_stat(unsigned long)
(ggc-page.c:1339)
==5852==    by 0x886F18: cgraph_create_edge_1(cgraph_node*, cgraph_node*,
gimple_statement_d*, long, int) (cgraph.c:793)
==5852==    by 0x88714F: cgraph_create_edge(cgraph_node*, cgraph_node*,
gimple_statement_d*, long, int) (cgraph.c:838)
==5852==    by 0x88F6BF: cgraph_analyze_function(cgraph_node*)
(cgraphunit.c:630)
==5852==    by 0x8906C8: cgraph_analyze_functions() (cgraphunit.c:964)
==5852==    by 0x8939A8: finalize_compilation_unit() (cgraphunit.c:2110)
==5852==    by 0x647071: cp_write_global_declarations() (decl2.c:4318)
==5852==    by 0xC63E12: compile_file() (toplev.c:557)
==5852==    by 0xC65DB5: do_compile() (toplev.c:1876)
==5852==    by 0xC65F20: toplev_main(int, char**) (toplev.c:1952)
==5852==    by 0x12EC1CD: main (main.c:36)

273  uid = (!gimple_has_body_p (edge->caller->symbol.decl)
274 ? edge->lto_stmt_uid : gimple_uid (edge->call_stmt));

gimple_has_body_p is false (edge->call_stmt is NULL, DECL_STRUCT_FUNCTION
(edge->caller->symbol.decl) is NULL), and lto_stmt_uid is clearly
uninitialized.

When run under gdb rather than valgrind where you can't make interior calls:
b lto-cgraph.c:273 if !gimple_has_body_p (edge->caller->symbol.decl) &&
edge->lto_stmt_uid == 0xafafafaf
shows
(gdb) p debug_generic_stmt (edge->caller->symbol.decl)
_ZThn528_N1D3fooEv
(gdb) p debug_generic_stmt (edge->callee->symbol.decl)
*.LTHUNK0

Which also shows why I haven't seen any such failures in
gcc/testsuite/gcc/gcc.log, while tons of them in gcc/testsuite/g++/g++.log -
bet only thunks don't have body here and the code doesn't count with those.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug lto/56532] valgrind errors with -flto
  2013-03-05 10:39 [Bug lto/56532] New: valgrind errors with -flto jakub at gcc dot gnu.org
@ 2022-01-02  4:30 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-02  4:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56532

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The only messages from valgrind I get these days are from IRA and LRA:
==15092== Command: ./cc1plus pr46984.C -O -fipa-cp -fno-early-inlining -flto
-quiet --param=ggc-min-expand=0 --param=ggc-min-heapsize=0 -ffat-lto-objects
==15092==
==15092== Conditional jump or move depends on uninitialised value(s)
==15092==    at 0x1526474: sparseset_bit_p(sparseset_def*, unsigned int)
(sparseset.h:146)
==15092==    by 0x1526F2A: mark_pseudo_regno_live(int) (ira-lives.c:326)
==15092==    by 0x15271D4: mark_pseudo_reg_live(rtx_def*, unsigned int)
(ira-lives.c:410)
==15092==    by 0x1527242: mark_ref_live(df_ref_d*) (ira-lives.c:424)
==15092==    by 0x1529ED2: process_bb_node_lives(ira_loop_tree_node*)
(ira-lives.c:1434)
==15092==    by 0x14FC954: ira_traverse_loop_tree(bool, ira_loop_tree_node*,
void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*))
(ira-build.c:1806)
==15092==    by 0x152AD38: ira_create_allocno_live_ranges() (ira-lives.c:1734)
==15092==    by 0x15012FE: ira_build() (ira-build.c:3433)
==15092==    by 0x14F6809: ira(_IO_FILE*) (ira.c:5752)
==15092==    by 0x14F71AC: (anonymous namespace)::pass_ira::execute(function*)
(ira.c:6075)
==15092==    by 0x168E8E5: execute_one_pass(opt_pass*) (passes.c:2637)
==15092==    by 0x168EC76: execute_pass_list_1(opt_pass*) (passes.c:2737)
==15092==  Uninitialised value was created by a heap allocation
==15092==    at 0x52B1B0F: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15092==    by 0x30557BC: xmalloc (xmalloc.c:149)
==15092==    by 0x17C76C7: sparseset_alloc(unsigned int) (sparseset.c:33)
==15092==    by 0x152ACAC: ira_create_allocno_live_ranges() (ira-lives.c:1727)
==15092==    by 0x15012FE: ira_build() (ira-build.c:3433)
==15092==    by 0x14F6809: ira(_IO_FILE*) (ira.c:5752)
==15092==    by 0x14F71AC: (anonymous namespace)::pass_ira::execute(function*)
(ira.c:6075)
==15092==    by 0x168E8E5: execute_one_pass(opt_pass*) (passes.c:2637)
==15092==    by 0x168EC76: execute_pass_list_1(opt_pass*) (passes.c:2737)
==15092==    by 0x168ECA7: execute_pass_list_1(opt_pass*) (passes.c:2738)
==15092==    by 0x168ECFF: execute_pass_list(function*, opt_pass*)
(passes.c:2748)
==15092==    by 0x110B4A2: cgraph_node::expand() (cgraphunit.c:1834)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-02  4:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-05 10:39 [Bug lto/56532] New: valgrind errors with -flto jakub at gcc dot gnu.org
2022-01-02  4:30 ` [Bug lto/56532] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).