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]

Re: [RFA] [PATCH][PR tree-optimization/59749] Fix recently introduced ree bug


On 01/16/14 04:52, Eric Botcazou wrote:
Yes, like in the attached patch?  OK for the trunk?

Unfortunately this broke again bootstrap with RTL checking enabled on x86-64:

/home/eric/svn/gcc/libgcc/libgcc2.c: In function '__negdi2':
/home/eric/svn/gcc/libgcc/libgcc2.c:71:1: internal compiler error: RTL check:
expected code 'reg', have 'ne' in rhs_regno, at rtl.h:1125
Here's what I'm checking in. No idea why I was looking at orig_src, that's just wrong. We want to compare # hard regs for the original destination's regno/mode vs the # hard regs for the new destination's regno/mode.

Bootstrapped & regression tested on x86_64-unknown-linux. Also bootstrapped with --enable-checking=rtl.

Installed on the trunk.


commit e9bbaae3fe335b8eef7022f684bc7c35926471ca
Author: Jeff Law <law@redhat.com>
Date:   Thu Jan 16 14:23:15 2014 -0700

           * ree.c (combine_set_extension): Correct test for changing number
            of hard registers when widening a reaching definition.

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e07d1ae..3fa6f5f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2014-01-16  Jeff Law  <law@redhat.com>
+
+	* ree.c (combine_set_extension): Correct test for changing number
+	of hard registers when widening a reaching definition.
+
 2014-01-16  Bernd Schmidt  <bernds@codesourcery.com>
 
 	PR middle-end/56791
diff --git a/gcc/ree.c b/gcc/ree.c
index 19d821c..96cddd2 100644
--- a/gcc/ree.c
+++ b/gcc/ree.c
@@ -300,7 +300,8 @@ combine_set_extension (ext_cand *cand, rtx curr_insn, rtx *orig_set)
   /* We're going to be widening the result of DEF_INSN, ensure that doing so
      doesn't change the number of hard registers needed for the result.  */
   if (HARD_REGNO_NREGS (REGNO (new_reg), cand->mode)
-      != HARD_REGNO_NREGS (REGNO (orig_src), GET_MODE (SET_DEST (*orig_set))))
+      != HARD_REGNO_NREGS (REGNO (SET_DEST (*orig_set)),
+			   GET_MODE (SET_DEST (*orig_set))))
 	return false;
 
   /* Merge constants by directly moving the constant into the register under

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