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

            Bug ID: 78454
           Summary: valgrind conditional jump or move depends on
                    uninitialised value(s) in sparseset_bit_p
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Running the latest trunk of GCC 7.0 under Valgrind shows the errors below.  I
see a report of a similar problem in bug 54689 was closed as invalid though it
references r190503 presumably committed to suppress the reported errors (?) 
Yet the suppression code was present when the bug was filed (with trunk as of
r191663) and is still there on trunk today so I'm not sure what to make of
that.

$ cat x.c && /build/gcc-trunk-svn/gcc/xgcc -B /build/gcc-trunk-svn/gcc -S x.c
-wrapper valgrind
int f (int x)
{
  return x;
}
==5831== Memcheck, a memory error detector
==5831== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==5831== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==5831== Command: /build/gcc-trunk-svn/gcc/cc1 -quiet -iprefix
/home/msebor/build/gcc-trunk-svn/gcc/../lib/gcc/x86_64-pc-linux-gnu/7.0.0/
-isystem /build/gcc-trunk-svn/gcc/include -isystem
/build/gcc-trunk-svn/gcc/include-fixed x.c -quiet -dumpbase x.c -mtune=generic
-march=x86-64 -auxbase x -o x.s
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xC8FA56: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xC904E4: mark_pseudo_regno_live(int) (ira-lives.c:289)
==5831==    by 0xC9079E: mark_pseudo_reg_live(rtx_def*, unsigned int)
(ira-lives.c:373)
==5831==    by 0xC9080B: mark_ref_live(df_ref_d*) (ira-lives.c:387)
==5831==    by 0xC92F59: process_bb_node_lives(ira_loop_tree_node*)
(ira-lives.c:1254)
==5831==    by 0xC68ED2: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void
(*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1806)
==5831==    by 0xC93D64: ira_create_allocno_live_ranges() (ira-lives.c:1565)
==5831==    by 0xC6D21A: ira_build() (ira-build.c:3422)
==5831==    by 0xC6393B: ira(_IO_FILE*) (ira.c:5217)
==5831==    by 0xC64154: (anonymous namespace)::pass_ira::execute(function*)
(ira.c:5522)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xC8FA56: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xC8FAE8: sparseset_set_bit(sparseset_def*, unsigned long)
(sparseset.h:166)
==5831==    by 0xC8FD5C: make_object_born(ira_object*) (ira-lives.c:120)
==5831==    by 0xC90505: mark_pseudo_regno_live(int) (ira-lives.c:293)
==5831==    by 0xC9079E: mark_pseudo_reg_live(rtx_def*, unsigned int)
(ira-lives.c:373)
==5831==    by 0xC9080B: mark_ref_live(df_ref_d*) (ira-lives.c:387)
==5831==    by 0xC92F59: process_bb_node_lives(ira_loop_tree_node*)
(ira-lives.c:1254)
==5831==    by 0xC68ED2: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void
(*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1806)
==5831==    by 0xC93D64: ira_create_allocno_live_ranges() (ira-lives.c:1565)
==5831==    by 0xC6D21A: ira_build() (ira-build.c:3422)
==5831==    by 0xC6393B: ira(_IO_FILE*) (ira.c:5217)
==5831==    by 0xC64154: (anonymous namespace)::pass_ira::execute(function*)
(ira.c:5522)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xCD8587: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xCD993F: check_pseudos_live_through_calls(int)
(lra-lives.c:570)
==5831==    by 0xCDA9FF: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:856)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831==    by 0xD95F64: execute_pass_list_1(opt_pass*) (passes.c:2460)
==5831==    by 0xD95FBA: execute_pass_list(function*, opt_pass*)
(passes.c:2470)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xCD8587: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xCD993F: check_pseudos_live_through_calls(int)
(lra-lives.c:570)
==5831==    by 0xCDA59D: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:785)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831==    by 0xD95F64: execute_pass_list_1(opt_pass*) (passes.c:2460)
==5831==    by 0xD95FBA: execute_pass_list(function*, opt_pass*)
(passes.c:2470)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xCD8587: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xCD8619: sparseset_set_bit(sparseset_def*, unsigned long)
(sparseset.h:166)
==5831==    by 0xCD8D92: make_hard_regno_dead(int) (lra-lives.c:255)
==5831==    by 0xCD916A: mark_regno_dead(int, machine_mode, int)
(lra-lives.c:348)
==5831==    by 0xCDA6E3: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:807)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xCD8587: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xCD90E5: mark_regno_live(int, machine_mode, int)
(lra-lives.c:323)
==5831==    by 0xCDA9E0: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:855)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831==    by 0xD95F64: execute_pass_list_1(opt_pass*) (passes.c:2460)
==5831==    by 0xD95FBA: execute_pass_list(function*, opt_pass*)
(passes.c:2470)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xCD8587: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xCD8E06: mark_pseudo_live(int, int) (lra-lives.c:268)
==5831==    by 0xCD90FB: mark_regno_live(int, machine_mode, int)
(lra-lives.c:325)
==5831==    by 0xCDA9E0: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:855)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831==    by 0xD95F64: execute_pass_list_1(opt_pass*) (passes.c:2460)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xCD8587: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xCD8619: sparseset_set_bit(sparseset_def*, unsigned long)
(sparseset.h:166)
==5831==    by 0xCD8E36: mark_pseudo_live(int, int) (lra-lives.c:269)
==5831==    by 0xCD90FB: mark_regno_live(int, machine_mode, int)
(lra-lives.c:325)
==5831==    by 0xCDA9E0: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:855)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xCD8587: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xCD8619: sparseset_set_bit(sparseset_def*, unsigned long)
(sparseset.h:166)
==5831==    by 0xCD8F62: mark_pseudo_live(int, int) (lra-lives.c:277)
==5831==    by 0xCD90FB: mark_regno_live(int, machine_mode, int)
(lra-lives.c:325)
==5831==    by 0xCDA9E0: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:855)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xE91AB2: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xE921C4: sparseset_and_compl(sparseset_def*, sparseset_def*,
sparseset_def*) (sparseset.c:190)
==5831==    by 0xCDAADC: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:870)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831==    by 0xD95F64: execute_pass_list_1(opt_pass*) (passes.c:2460)
==5831==    by 0xD95FBA: execute_pass_list(function*, opt_pass*)
(passes.c:2470)
==5831== 
==5831== Use of uninitialised value of size 8
==5831==    at 0xE91AC6: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xE921C4: sparseset_and_compl(sparseset_def*, sparseset_def*,
sparseset_def*) (sparseset.c:190)
==5831==    by 0xCDAADC: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:870)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831==    by 0xD95F64: execute_pass_list_1(opt_pass*) (passes.c:2460)
==5831==    by 0xD95FBA: execute_pass_list(function*, opt_pass*)
(passes.c:2470)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xE91AB2: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xE91B44: sparseset_set_bit(sparseset_def*, unsigned long)
(sparseset.h:166)
==5831==    by 0xE921DE: sparseset_and_compl(sparseset_def*, sparseset_def*,
sparseset_def*) (sparseset.c:191)
==5831==    by 0xCDAADC: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:870)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831==    by 0xD95F64: execute_pass_list_1(opt_pass*) (passes.c:2460)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xCD8587: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xCD8619: sparseset_set_bit(sparseset_def*, unsigned long)
(sparseset.h:166)
==5831==    by 0xCD8FF4: mark_pseudo_dead(int, int) (lra-lives.c:292)
==5831==    by 0xCD91A3: mark_regno_dead(int, machine_mode, int)
(lra-lives.c:354)
==5831==    by 0xCDA6E3: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:807)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831== 
==5831== Conditional jump or move depends on uninitialised value(s)
==5831==    at 0xCD8587: sparseset_bit_p(sparseset_def*, unsigned long)
(sparseset.h:147)
==5831==    by 0xCD8619: sparseset_set_bit(sparseset_def*, unsigned long)
(sparseset.h:166)
==5831==    by 0xCD8C05: make_hard_regno_born(int, bool) (lra-lives.c:236)
==5831==    by 0xCD90BF: mark_regno_live(int, machine_mode, int)
(lra-lives.c:319)
==5831==    by 0xCDA9E0: process_bb_lives(basic_block_def*, int&, bool)
(lra-lives.c:855)
==5831==    by 0xCDBFDC: lra_create_live_ranges_1(bool, bool)
(lra-lives.c:1255)
==5831==    by 0xCDC2BB: lra_create_live_ranges(bool, bool) (lra-lives.c:1320)
==5831==    by 0xCB82BF: lra(_IO_FILE*) (lra.c:2450)
==5831==    by 0xC63D56: do_reload() (ira.c:5381)
==5831==    by 0xC641EE: (anonymous namespace)::pass_reload::execute(function*)
(ira.c:5565)
==5831==    by 0xD95BE3: execute_one_pass(opt_pass*) (passes.c:2370)
==5831==    by 0xD95F33: execute_pass_list_1(opt_pass*) (passes.c:2459)
==5831== 
==5831== 
==5831== HEAP SUMMARY:
==5831==     in use at exit: 1,608,570 bytes in 2,264 blocks
==5831==   total heap usage: 5,135 allocs, 2,871 frees, 3,621,619 bytes
allocated
==5831== 
==5831== LEAK SUMMARY:
==5831==    definitely lost: 0 bytes in 0 blocks
==5831==    indirectly lost: 0 bytes in 0 blocks
==5831==      possibly lost: 8,032 bytes in 1 blocks
==5831==    still reachable: 1,600,538 bytes in 2,263 blocks
==5831==         suppressed: 0 bytes in 0 blocks
==5831== Rerun with --leak-check=full to see details of leaked memory
==5831== 
==5831== For counts of detected and suppressed errors, rerun with: -v
==5831== Use --track-origins=yes to see where uninitialised values come from
==5831== ERROR SUMMARY: 37 errors from 14 contexts (suppressed: 0 from 0)

Reply via email to