From patchwork Fri Feb 22 13:30:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix PR 56077 Date: Fri, 22 Feb 2013 03:30:29 -0000 From: Andrey Belevantsev X-Patchwork-Id: 222531 Message-Id: <512772F5.3040007@ispras.ru> To: GCC Patches Cc: "Vladimir N. Makarov" , Alexander Monakov Hello, As found by Jakub and explained in the PR audit trail by Alexander, this patch fixes the selective scheduler merge glitch of 2008 that added the unnecessary JUMP_P check to the flush_pending_lists call. I have removed the check and expanded the binary negation for clarity. The patch was tested on x86-64, ia64, and ppc64 to be safe. The patch should be conservatively safe at this stage as it adds more flushes and thus more dependencies to the scheduler. The original test is fixed, but I don't know how to add the test checking assembly insns order to the testsuite. OK for trunk? Andrey 2012-02-22 Alexander Monakov Andrey Belevantsev PR middle-end/56077 * sched-deps.c (sched_analyze_insn): When reg_pending_barrier, flush pending lists also on non-jumps. Index: gcc/sched-deps.c =================================================================== *** gcc/sched-deps.c (revision 196136) --- gcc/sched-deps.c (working copy) *************** sched_analyze_insn (struct deps_desc *de *** 3318,3325 **** } /* Flush pending lists on jumps, but not on speculative checks. */ ! if (JUMP_P (insn) && !(sel_sched_p () ! && sel_insn_is_speculation_check (insn))) flush_pending_lists (deps, insn, true, true); reg_pending_barrier = NOT_A_BARRIER; --- 3318,3324 ---- } /* Flush pending lists on jumps, but not on speculative checks. */ ! if (!sel_sched_p () || !sel_insn_is_speculation_check (insn)) flush_pending_lists (deps, insn, true, true); reg_pending_barrier = NOT_A_BARRIER;