From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32243 invoked by alias); 14 Oct 2012 16:23:27 -0000 Received: (qmail 32195 invoked by uid 48); 14 Oct 2012 16:23:08 -0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build Date: Sun, 14 Oct 2012 16:23:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: 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/msg01313.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54691 --- Comment #7 from Uros Bizjak 2012-10-14 16:23:04 UTC --- Created attachment 28445 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28445 Prototype patch that introduces VALGRIND_MAKE_MEM_DEFINED Attached prototype patch builds on HJ's patch. The patch detects valgrind in the same way as in gcc directory (actually, it just copies relevant bits) and changes: + memset (to.text + to.len + 1, 0, 16); to + VALGRIND_DISCARD (VALGRIND_MAKE_MEM_DEFINED (to.text + to.len + 1, 16)); (BTW: Probably, we should align end of buffer to 16 byte boundary instead of hardcoding 16.) (BTW2: the test in the following code in the patch is obviously wrong: +if test $enable_checking != no ; then + # It is certainly possible that there's valgrind but no valgrind.h. + # GCC relies on making annotations so we must have both. + AC_MSG_CHECKING(for VALGRIND_DISCARD in ) + AC_PREPROC_IFELSE([AC_LANG_SOURCE( ...)