From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24293 invoked by alias); 16 May 2013 11:26:17 -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 24189 invoked by uid 48); 16 May 2013 11:26:05 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/57300] [4.8/4.9 Regression] statement in expression miscompiled at -O3 in 32-bit mode Date: Thu, 16 May 2013 11:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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.8.1 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: 2013-05/txt/msg01106.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57300 --- Comment #13 from Richard Biener --- (In reply to Steven Bosscher from comment #9) > (In reply to Jakub Jelinek from comment #6) > > So supposedly > > bool > > split_dead_or_set_p (rtx insn, const_rtx x) > > { > > if (BLOCK_FOR_INSN (insn) == NULL) > > return false; /* If cfg is gone, be conservative. */ > > if (df_note == NULL) > > { > > df_note_add_problem (); > > df_analyze (); > > } > > return dead_or_set_p (insn, x); > > } > > > > could work. Steven, comments? > > I don't think this will work. The fact that df_note != NULL does not > mean the notes are up-to-date. > > It seems to me that after freeing the CFG, no pass should rely on the > REG_DEAD and REG_UNUSED notes if Eric's comment in PR57281 is correct: > That each pass is responsible for re-computing the notes if it needs > them. But I would much rather have the passes at least discard the > notes if the pass can't update them. After all, it's not just this > dead_or_set_p function that relies on these notes, but also single_set > and a bunch of other functions. I agree that possibly bogus IL is a smoking gun that waits for this kind of bugs to appear. If we do not want to pay the price of removing notes can we at least have a flag that tells whether the NOTE problem is up-to-date (and add verification that it indeed is - at least has no bogus notes - when that flag is set)? We could introduce a new PROP_rtl_notes for that. As for the case in question in PR57281 - it shouldn't be hard for postreload to remove REG_DEAD notes from all uses when it propagates equivalencies, no? Btw, as alternative to computing the NOTE problem at the start of split we can also remove all notes which should be cheaper.