From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12917 invoked by alias); 8 Jan 2014 11:08:50 -0000 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 Received: (qmail 12876 invoked by uid 48); 8 Jan 2014 11:08:46 -0000 From: "vries at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/59715] [4.7/4.8/4.9 Regression] wrong code at -Os and above on x86_64-linux-gnu Date: Wed, 08 Jan 2014 11:08: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-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-01/txt/msg00754.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59715 --- Comment #5 from vries at gcc dot gnu.org --- The test passes with -fno-tree-tail-merge. But I don't see anything wrong with the transformation (merging of empty blocks) done by the pass. AFAICT, the problem is introduced by pass_dominator. test.c.126t.slsr looks ok, but test.c.127t.dom2 look wrong. The test passes with -fno-tree-dominator-opts. test.c.126t.slsr: ... : b.0_4 = b; if (b.0_4 == 0) goto ; else goto ; : goto ; : a.1_5 = a; if (a.1_5 != 0) goto ; else goto ; : b = a.1_5; c_7 = 1 % a.1_5; if (c_7 != 0) goto ; else goto ; : b = 0; : b.0_9 = b; printf ("%d\n", b.0_9); return 0; ... we're taking the path bb2 -> bb4 -> bb5 (b = 2) -> bb6 (b = 0) -> bb7 test.c.127t.dom2: ... : b.0_4 = b; if (b.0_4 == 0) goto ; else goto ; : goto ; : a.1_5 = a; if (a.1_5 != 0) goto ; else goto ; : b = a.1_5; c_7 = 1 % a.1_5; if (c_7 != 0) goto ; else goto ; : b.0_9 = b; printf ("%d\n", b.0_9); return 0; ... we're taking the path bb2 -> bb4 -> bb5 (b = 2) -> bb6