From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17929 invoked by alias); 11 Nov 2012 09:22:28 -0000 Received: (qmail 17733 invoked by uid 48); 11 Nov 2012 09:22:13 -0000 From: "markus at trippelsdorf dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/55253] [4.8 Regression] Revision 193298 miscompiles sqlite with -Os Date: Sun, 11 Nov 2012 09:22:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: markus at trippelsdorf dot de 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: 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-11/txt/msg00931.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55253 --- Comment #1 from Markus Trippelsdorf 2012-11-11 09:22:12 UTC --- Reduced: markus@x4 /tmp % cat test.i struct { int mallocFailed; } *a; struct StrAccum { int useMalloc; } b, c; static void fn1 (struct StrAccum *p1, int p2) { if (p2 == 0) return; if (p1->useMalloc) a->mallocFailed = 0; } void fn2 (struct StrAccum *p1) { fn1 (p1, 1); } void fn3 (struct StrAccum *p1) { fn1 (p1, 1); } void fn4 () { c.useMalloc = 1; fn1 (&c, 0); } int main () { fn3 (&b); return 0; } markus@x4 /tmp % gcc -Os test.i && ./a.out [1] 25665 segmentation fault ./a.out markus@x4 /tmp % gcc -O2 test.i && ./a.out markus@x4 /tmp %