https://bugs.kde.org/show_bug.cgi?id=387766

            Bug ID: 387766
           Summary: asm shifts cause false positive "Conditional jump or
                    move depends on uninitialised value"
           Product: valgrind
           Version: 3.14 SVN
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: jsew...@acm.org
          Reporter: octopl...@yandex.com
  Target Milestone: ---

Running gcc trunk under valgrind produces many false positives, e.g.:

==20511== Conditional jump or move depends on uninitialised value(s)            
==20511==    at 0xBBA16D: update_costs_from_copies(ira_allocno*, bool, bool)
(in /home/trippels/gcc_build_dir_/gcc/cc1)
==20511==    by 0xBBB0ED: assign_hard_reg(ira_allocno*, bool) (in
/home/trippels/gcc_build_dir_/gcc/cc1)
==20511==    by 0xBBF527: color_allocnos() (in
/home/trippels/gcc_build_dir_/gcc/cc1)
==20511==    by 0xBC011B: color_pass(ira_loop_tree_node*) (in
/home/trippels/gcc_build_dir_/gcc/cc1)
==20511==    by 0xBA7EAE: ira_traverse_loop_tree(bool, ira_loop_tree_node*,
void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*))
(ira-build.c:1781)
==20511==    by 0xBB91C2: ira_color() (in
/home/trippels/gcc_build_dir_/gcc/cc1)
==20511==    by 0xBA33B4: ira (ira.c:5286)                              
==20511==    by 0xBA33B4: (anonymous namespace)::pass_ira::execute(function*)
(ira.c:5584)
==20511==    by 0xC5FD98: execute_one_pass(opt_pass*) (passes.c:2497)
==20511==    by 0xC60574: execute_pass_list_1(opt_pass*) (passes.c:2586)        
==20511==    by 0xC60586: execute_pass_list_1(opt_pass*) (passes.c:2587)
==20511==    by 0xC605B8: execute_pass_list(function*, opt_pass*)
(passes.c:2597)
==20511==    by 0x9A2DC2: cgraph_node::expand() (cgraphunit.c:2139)
==20511==  Uninitialised value was created by a client request                  
==20511==    at 0x8F411D: base_pool_allocator<memory_block_pool>::allocate()
(alloc-pool.h:419)                                                              
==20511==    by 0xBAA640: allocate (alloc-pool.h:502)
==20511==    by 0xBAA640: ira_create_allocno(int, bool, ira_loop_tree_node*)
(ira-build.c:486)
==20511==    by 0xBAAB33: create_insn_allocnos(rtx_def*, rtx_def*, bool)
(ira-build.c:1852)
==20511==    by 0xBAAF74: create_bb_allocnos (ira-build.c:1918)
==20511==    by 0xBAAF74: create_loop_tree_node_allocnos(ira_loop_tree_node*)
(ira-build.c:1964)
==20511==    by 0xBA81AB: ira_traverse_loop_tree(bool, ira_loop_tree_node*,
void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*))
(ira-build.c:1799)
==20511==    by 0xBACD38: create_allocnos (ira-build.c:2060)
==20511==    by 0xBACD38: ira_build() (ira-build.c:3420)
==20511==    by 0xBA331F: ira (ira.c:5273)
==20511==    by 0xBA331F: (anonymous namespace)::pass_ira::execute(function*)
(ira.c:5584)
==20511==    by 0xC5FD98: execute_one_pass(opt_pass*) (passes.c:2497)
==20511==    by 0xC60574: execute_pass_list_1(opt_pass*) (passes.c:2586)
==20511==    by 0xC60586: execute_pass_list_1(opt_pass*) (passes.c:2587)
==20511==    by 0xC605B8: execute_pass_list(function*, opt_pass*)
(passes.c:2597)
==20511==    by 0x9A2DC2: cgraph_node::expand() (cgraphunit.c:2139)

(gcc was configured with --enable-valgrind-annotations)

alloc-pool.h:419 reads:
 419   VALGRIND_DISCARD (VALGRIND_MAKE_MEM_UNDEFINED (header, size)); 

On x86 gcc trunk doesn't tune for partial_flag_reg_stall anymore.
This causes redundant test instructions after shifts to be removed. 

Asm diff of update_costs_from_copies():
@@ -7464,7 +7461,6 @@                       
        movl    12(%rbp), %edx              
        sall    $10, %edx                   
        sarl    $16, %edx                   
-       testl   %edx, %edx                  
        js      .L1438                      
        movq    40(%rsp), %r9               
        movq    72(%rsp), %r11

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to