From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5059 invoked by alias); 30 Dec 2010 13:19:34 -0000 Received: (qmail 5050 invoked by uid 22791); 30 Dec 2010 13:19:34 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CF X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 30 Dec 2010 13:19:30 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/47028] [4.6 Regression] gcc.dg/tree-ssa/tailrecursion-[57].c FAIL with -foptimize-sibling-calls -fno-forward-propagate -fno-tree-copy-prop -fno-tree-dominator-opts 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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 4.6.0 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 Date: Thu, 30 Dec 2010 13:19:00 -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 X-SW-Source: 2010-12/txt/msg02957.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47028 --- Comment #2 from Jakub Jelinek 2010-12-30 13:19:21 UTC --- The problem is much earlier than that. In *.expand we have: ;; Start of basic block ( 0) -> 2 ;; Pred edge ENTRY [100.0%] (fallthru) (note 12 6 9 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (insn 9 12 7 2 (set (reg/v:SI 70 [ n ]) (reg/v:SI 72 [ n ])) pr47028.c:7 -1 (nil)) (insn 7 9 8 2 (set (reg/v:SI 72 [ n ]) (reg:SI 5 di [ n ])) pr47028.c:7 -1 (nil)) where obviously insn 7 should be before insn 9, not the other way around. The reason it is emitted that way is because in *.optimized we have: : # n_13 = PHI and insn 9 is insert_partition_copy_on_edge'ed on the ENTRY_BLOCK_PTR -> bb 2 edge, which is before the argument setup. So, either insertions on the single edge from ENTRY_BLOCK_PTR to the entry bb should be committed after parm_birth_insn instead of the start of that bb, or we need to ensure even if the user ridiculously turns off all optimization passes that clean up degenerated PHIs they get cleaned up somewhere. The PHI here is created during tail recursion pass, but at that point it is not degenerate PHI, it only becomes one during some cfg cleanup afterwards.