This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][PR middle-end/79521] Refine condition for calling ira_init_register_move_cost_if_necessary



ira_init_register_move_cost_if_necessary asserts have_regs_of_mode[MODE] is true. We need to make sure not to call ira_init_register_move_cost_if_necessary when have_regs_of_mode[MODE] is false.

Verified the H8 port still builds libgcc, also bootstrapped and regression tested on x86_64-linux-gnu and i686-linux-gnu.

Installing on the trunk.

Sorry for the breakage,
Jeff
commit 8f78832934c603a04db68329c195184a142f04a6
Author: Jeff Law <law@redhat.com>
Date:   Wed Feb 15 23:35:08 2017 -0700

    	PR middle-end/79521
    	* ira-costs.c (scan_one_insn): Check have_regs_of_mode before calling
    	ira_init_register_move_cost_if_necessary.

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d99f444..24d9c15 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-02-15 Jeff Law  <law@redhat.com>
+
+	PR middle-end/79521
+	* ira-costs.c (scan_one_insn): Check have_regs_of_mode before calling
+	ira_init_register_move_cost_if_necessary.
+
 2017-02-15  Martin Sebor  <msebor@redhat.com>
 
 	PR middle-end/32003
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index 1737430..9cf0119 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -1452,7 +1452,8 @@ scan_one_insn (rtx_insn *insn)
     {
       rtx x = XEXP (PATTERN (insn), 0);
       if (GET_CODE (x) == REG
-	  && REGNO (x) >= FIRST_PSEUDO_REGISTER)
+	  && REGNO (x) >= FIRST_PSEUDO_REGISTER
+	  && have_regs_of_mode[GET_MODE (x)])
         ira_init_register_move_cost_if_necessary (GET_MODE (x));
       return insn;
     }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]