From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22983 invoked by alias); 27 Feb 2013 16:11:40 -0000 Received: (qmail 22778 invoked by uid 48); 27 Feb 2013 16:11:05 -0000 From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/56294] BOOT_CFLAGS='-O2 -g -fno-ipa-sra' leads to bootstrap comparison failure Date: Wed, 27 Feb 2013 16:11: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: jamborm 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: --- X-Bugzilla-Changed-Fields: Status AssignedTo 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: 2013-02/txt/msg02601.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56294 Martin Jambor changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW AssignedTo|jamborm at gcc dot gnu.org |unassigned at gcc dot | |gnu.org --- Comment #11 from Martin Jambor 2013-02-27 16:11:02 UTC --- OK, patch http://gcc.gnu.org/ml/gcc-patches/2013-02/msg01233.html fixes the testcase from comment #7 and patch http://gcc.gnu.org/ml/gcc-patches/2013-02/msg01235.html should avoid some further (although apparently not that crucial) differences in SRA -g and -g0 output. Unfortunately, they do not fix the debug comparison failure from comment #9. The problematic difference is: --- testcase.gkd 2013-02-27 16:25:54.036565436 +0100 +++ testcase.gk.gkd 2013-02-27 16:25:54.185565083 +0100 @@ -140,3 +140,3 @@ (insn:TI# 0 0 5 (set (reg/f:DI 6 bp [orig:62 D.xxxx ] [62]) - (mem/f:DI (const_int 0 [0]) [ *control_var_27(D)+0 S8 A64])) testcase.ii:166# {*movdi_internal_rex64} + (mem/f:DI (const_int 0 [0]) [ *control_var_28(D)+0 S8 A64])) testcase.ii:166# {*movdi_internal_rex64} (nil)) and appears for the first time in release_ssa pass. It seems to me that (right after early SRA), two SSA names simply have a different order in -g0 and -g compilations: -SSA_NAME 63: elim_cost$complexity_63 - DEF: elim_cost$complexity_63 = PHI +SSA_NAME 63: cost$cost_63 + DEF: cost$cost_63 = PHI -SSA_NAME 71: cost$cost_71 - DEF: cost$cost_71 = PHI +SSA_NAME 71: elim_cost$complexity_71 + DEF: elim_cost$complexity_71 = PHI Also, if I just do not produce DEBUG statements with elim_cost$complexity on the RHS, the problem goes away. However, I do not anything wrong with the statements. Later, just before release_ssa, three SSA names have different order: -SSA_NAME 67: .MEM_67 - DEF: comp ={v} {CLOBBER}; +SSA_NAME 63: cost$cost_63 + DEF: cost$cost_63 = PHI -SSA_NAME 70: control_var_70(D) - DEF: GIMPLE_NOP +SSA_NAME 67: .MEM_67 + DEF: comp ={v} {CLOBBER}; -SSA_NAME 71: cost$cost_71 - DEF: cost$cost_71 = PHI +SSA_NAME 70: control_var_70(D) + DEF: GIMPLE_NOP ...and control_var manages to leak to the final dump, causing the failure. I'll return to this bug in a few days, but now I need a break from it, so I'm un-assigning myself.