From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29550 invoked by alias); 16 Dec 2012 18:23:47 -0000 Received: (qmail 29475 invoked by uid 48); 16 Dec 2012 18:23:26 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/55679] new asan tests from r194458 fail on x86_64-apple-darwin10 Date: Sun, 16 Dec 2012 18:23:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr 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-12/txt/msg01637.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55679 --- Comment #16 from Dominique d'Humieres 2012-12-16 18:23:24 UTC --- (In reply to comments #12 and #13) With -O1, the invalid tests c-c++-common/asan/global-overflow-1.c and c-c++-common/asan/stack-overflow-1.c are optimized to a valid "return 0" as shown by the following differences between the outputs of -dump-tree-optimized with and without -fno-tree-fre: --- stack-overflow-1.c.164t.optimized 2012-12-16 17:26:13.000000000 +0100 +++ stack-overflow-1.c.164t_f.optimized 2012-12-16 17:25:13.000000000 +0100 @@ -3,18 +3,14 @@ main () { - int res; char x[10]; int ten.1; - char _4; : __builtin_memset (&x, 0, 10); ten.1_3 ={v} ten; - _4 = x[ten.1_3]; - res_5 = (int) _4; x ={v} {CLOBBER}; - return res_5; + return 0; } So the problem for these two tests has nothing to do with asan. Note that they regress cleanly if I add '-fno-tree-fre -fno-tree-pre' to '-fno-builtin-memset' in the dg-options. The optimization is also defeated If I add a line such as x[1] = 1; Although I doubt this behavior is a bug, I'll open a new PR for it tomorrow unless there is some objection.