Command line:
gcc -fsched-pressure -fschedule-insns -c testcase.c

Tested revisions:
r156367 - fail

------- testcase.c --------
int foo(void)
{
        return 0;
}
---------------------------

Output:
$ valgrind --track-origins=yes
/mnt/svn/gcc-trunk/binary-156367-lto/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
-fsched-pressure -fschedule-insns testcase.c 
==15355== Memcheck, a memory error detector
==15355== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==15355== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==15355== Command:
/mnt/svn/gcc-trunk/binary-156367-lto/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
-fsched-pressure -fschedule-insns testcase.c
==15355==                                                                       
 int foo()                                                                      
Analyzing compilation unit                                                      
Performing interprocedural optimizations                                        
 <visibility> <*free_lang_data> <early_local_cleanups> <whole-program>
<inline>Assembling functions:                                                   
 int foo()==15355== Conditional jump or move depends on uninitialised value(s)  
==15355==    at 0xD35F88: setup_insn_max_reg_pressure (haifa-sched.c:1597)      
==15355==    by 0x8A9C5F: schedule_insns (sched-rgn.c:2965)                     
==15355==    by 0x8A9DFD: rest_of_handle_sched (sched-rgn.c:3512)               
==15355==    by 0x84FEEA: execute_one_pass (passes.c:1561)                      
==15355==    by 0x850174: execute_pass_list (passes.c:1616)                     
==15355==    by 0x850186: execute_pass_list (passes.c:1617)                     
==15355==    by 0x945C34: tree_rest_of_compilation (tree-optimize.c:413)        
==15355==    by 0xAC70A0: cgraph_expand_function (cgraphunit.c:1543)            
==15355==    by 0xAC7E1F: cgraph_output_in_order (cgraphunit.c:1719)            
==15355==    by 0xAC9E4E: cgraph_optimize (cgraphunit.c:1867)                   
==15355==    by 0xACA024: cgraph_finalize_compilation_unit (cgraphunit.c:1093)  
==15355==    by 0x54E4DA: cp_write_global_declarations (decl2.c:3798)           
==15355==  Uninitialised value was created by a heap allocation                 
==15355==    at 0x4C280AC: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)                          
==15355==    by 0xDE78D7: xmalloc (xmalloc.c:147)                               
==15355==    by 0xD7CD78: sched_analyze_insn (sched-deps.c:2036)                
==15355==    by 0xD7D294: deps_analyze_insn (sched-deps.c:3248)                 
==15355==    by 0xD7DA43: sched_analyze (sched-deps.c:3398)                     
==15355==    by 0x8A819D: sched_rgn_compute_dependencies (sched-rgn.c:2726)     
==15355==    by 0x8A9827: schedule_insns (sched-rgn.c:2938)                     
==15355==    by 0x8A9DFD: rest_of_handle_sched (sched-rgn.c:3512)               
==15355==    by 0x84FEEA: execute_one_pass (passes.c:1561)                      
==15355==    by 0x850174: execute_pass_list (passes.c:1616)                     
==15355==    by 0x850186: execute_pass_list (passes.c:1617)                     
==15355==    by 0x945C34: tree_rest_of_compilation (tree-optimize.c:413)        
==15355==                                                                       
==15355== Conditional jump or move depends on uninitialised value(s)            
==15355==    at 0xD35F88: setup_insn_max_reg_pressure (haifa-sched.c:1597)      
==15355==    by 0xD3BE48: schedule_insn (haifa-sched.c:1632)                    
==15355==    by 0xD3E9D0: schedule_block (haifa-sched.c:3143)                   
==15355==    by 0x8A9B09: schedule_insns (sched-rgn.c:3001)                     
==15355==    by 0x8A9DFD: rest_of_handle_sched (sched-rgn.c:3512)               
==15355==    by 0x84FEEA: execute_one_pass (passes.c:1561)                      
==15355==    by 0x850174: execute_pass_list (passes.c:1616)                     
==15355==    by 0x850186: execute_pass_list (passes.c:1617)                     
==15355==    by 0x945C34: tree_rest_of_compilation (tree-optimize.c:413)        
==15355==    by 0xAC70A0: cgraph_expand_function (cgraphunit.c:1543)            
==15355==    by 0xAC7E1F: cgraph_output_in_order (cgraphunit.c:1719)            
==15355==    by 0xAC9E4E: cgraph_optimize (cgraphunit.c:1867)                   
==15355==  Uninitialised value was created by a heap allocation                 
==15355==    at 0x4C280AC: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)                          
==15355==    by 0xDE78D7: xmalloc (xmalloc.c:147)                               
==15355==    by 0xD7CD78: sched_analyze_insn (sched-deps.c:2036)                
==15355==    by 0xD7D294: deps_analyze_insn (sched-deps.c:3248)                 
==15355==    by 0xD7DA43: sched_analyze (sched-deps.c:3398)                     
==15355==    by 0x8A819D: sched_rgn_compute_dependencies (sched-rgn.c:2726)     
==15355==    by 0x8A9827: schedule_insns (sched-rgn.c:2938)                     
==15355==    by 0x8A9DFD: rest_of_handle_sched (sched-rgn.c:3512)               
==15355==    by 0x84FEEA: execute_one_pass (passes.c:1561)                      
==15355==    by 0x850174: execute_pass_list (passes.c:1616)                     
==15355==    by 0x850186: execute_pass_list (passes.c:1617)                     
==15355==    by 0x945C34: tree_rest_of_compilation (tree-optimize.c:413)        
==15355==                                                                       
With more complicated code more warnings are issued. I wasn't able to cause
difference in code generated with different --malloc-fill.


-- 
           Summary: -fsched-pressure -fschedule-insns - valgrind warns about
                    using uninitialized variable
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zsojka at seznam dot cz
  GCC host triplet: x86(_64)-pc-linux-gnu
GCC target triplet: x86(_64)-pc-linux-gnu


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

Reply via email to