From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7025 invoked by alias); 4 Feb 2014 09:37: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 Received: (qmail 6555 invoked by uid 48); 4 Feb 2014 09:36:55 -0000 From: "abel at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/60043] -fschedule-insns2 breaks anti-dependency Date: Tue, 04 Feb 2014 09:37: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.9.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: abel at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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-02/txt/msg00263.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60043 --- Comment #5 from Andrey Belevantsev --- (In reply to Richard Biener from comment #4) > Hmm, oops. The testcase has a true dependence ... ;) Still, isn't the > code in sched_analyze_2 wrong? Or are pending_mems all before 't'? Yes (to second question :). The analysis code roughly works like this (sched_analyze is the entry point): - process insns one by one in a bb/ebb doing two things in parallel: o mark reads/writes to registers, writes/reads to mems of this insn in various fields of the deps context; and o find dependencies between this insn reads/writes of registers/memory and previously noted reads/writes of the same register or memory from the deps context. So the pending_mem read/write will always happen before the currently processing insn mem read/write.