This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] rtl-optimization/64935: Sorting of ready list is different with/without DEBUG_INSNs.
- From: Jeff Law <law at redhat dot com>
- To: Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Vladimir Makarov <vmakarov at redhat dot com>
- Date: Wed, 18 Feb 2015 14:38:46 -0700
- Subject: Re: [PATCH] rtl-optimization/64935: Sorting of ready list is different with/without DEBUG_INSNs.
- Authentication-results: sourceware.org; auth=none
- References: <267A30E3-CD37-482F-9E8C-DE829544CC79 at linaro dot org>
On 02/18/15 09:02, Maxim Kuvyrkov wrote:
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?
From 339d0af94509796d08101724ea54e1d3787f89f2 Mon Sep 17 00:00:00 2001
From: Maxim Kuvyrkov<email@example.com>
Date: Wed, 18 Feb 2015 15:27:49 +0000
Subject: [PATCH] Fix PR64935
* haifa-sched.c (enum rfs_decision, rfs_str): Remove RFS_DEBUG.
(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,