From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16756 invoked by alias); 3 Oct 2012 06:34:39 -0000 Received: (qmail 12915 invoked by uid 48); 3 Oct 2012 06:34:20 -0000 From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/54783] [4.8 Regression] valgrind reports using uninitialised data in mark_pseudo_regno_live and make_object_born on basic code Date: Wed, 03 Oct 2012 06:34:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg00182.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54783 Marek Polacek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mpolacek at gcc dot gnu.org --- Comment #1 from Marek Polacek 2012-10-03 06:34:18 UTC --- Not a bug, probably. Valgrind ought to be used only when --enable-checking=valgrind. Otherwise we have to live with those sparseset warnings, as those valgrind markups aren't compiled in. The thing is in gcc-4.7 sparseset_alloc we have: /* We use xcalloc rather than xmalloc to silence some valgrind uninitialized read errors when accessing set->sparse[n] when "n" is not, and never has been, in the set. These uninitialized reads are expected, by design and harmless. If this turns into a performance problem due to some future additional users of sparseset, we can revisit this decision. */ sparseset set = (sparseset) xcalloc (1, n_bytes); But in trunk sparseset_alloc there's: sparseset set = XNEWVAR(struct sparseset_def, n_bytes); /* Mark the sparseset as defined to silence some valgrind uninitialized read errors when accessing set->sparse[n] when "n" is not, and never has been, in the set. These uninitialized reads are expected, by design and harmless. */ VALGRIND_DISCARD (VALGRIND_MAKE_MEM_DEFINED (set, n_bytes));