public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zsojka at seznam dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/42941]  New: -fsched-pressure -fschedule-insns - valgrind warns about using uninitialized variable
Date: Tue, 02 Feb 2010 21:30:00 -0000	[thread overview]
Message-ID: <bug-42941-14164@http.gcc.gnu.org/bugzilla/> (raw)

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	other threads:[~2010-02-02 21:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 21:30 zsojka at seznam dot cz [this message]
2010-02-02 21:32 ` [Bug rtl-optimization/42941] " zsojka at seznam dot cz
2010-02-03 10:40 ` rguenth at gcc dot gnu dot org
2010-02-03 18:57 ` vmakarov at redhat dot com
2010-02-03 19:02 ` vmakarov at gcc dot gnu dot org
2010-02-07 20:57 ` pinskia at gcc dot gnu dot org
2010-03-13  2:52 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-42941-14164@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).