On 02/18/15 09:02, Maxim Kuvyrkov wrote:
Hi,

This patch fixes PR64935, which is triggered when ready list at the start of a 
basic block is greater than --param=max-sched-ready-insns.  Sorting the ready 
list when it has more than max-sched-ready-insns elements is special in that we 
want to sort normal insns even if there are debug insns in the list.  This is 
due to code for max-sched-ready-insns ignoring debug insns on purpose.

The problem in the bug can be fixed with a smallish patch 
(seehttps://gcc.gnu.org/bugzilla/attachment.cgi?id=34674), but it makes code 
look ugly and non-intuitive.  The second version of the patch (the one attached 
here) is a bit bigger, but it gives functions definitive and clear purpose, and 
makes code easier to understand.

While reviewing the patch I suggest using context diff mode (in emacs C-c C-d). 
 I couldn't convince git to generate context diff.

Bootstrapped/tested on x86_64-linux-gnu and cross-tested on 
arm-linux-gnueabihf.  Markus also tested this patch on powerpc64-linux-gnu.

OK for trunk?

Thank you,

--
Maxim Kuvyrkov
www.linaro.org



0001-Fix-PR64935.patch


 From 339d0af94509796d08101724ea54e1d3787f89f2 Mon Sep 17 00:00:00 2001
From: Maxim Kuvyrkov<maxim.kuvyr...@linaro.org>
Date: Wed, 18 Feb 2015 15:27:49 +0000
Subject: [PATCH] Fix PR64935

        * haifa-sched.c (enum rfs_decision, rfs_str): Remove RFS_DEBUG.
        (rank_for_schedule_debug): Update.
        (ready_sort): Make static.  Move sorting logic to ...
        (ready_sort_debug, ready_sort_real): New static functions.
        (schedule_block): Sort both debug insns and real insns in preparation
        for ready list trimming.  Improve debug output.
        * sched-int.h (ready_sort): Remove global declaration.

        * gcc.dg/pr64935-1.c, gcc.dg/pr64935-2.c: New tests.
This is fine.   Thanks,
jeff

Reply via email to