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] rs6000: Don't use REGNO in the add<mode>3 expander


The argument could be a subreg of reg instead, which means we have to
use reg_or_subregno instead of REGNO.

Found by --enable-checking=rtl.  Tested on powerpc64-linux {-m32,-m64};
committing to trunk.


Segher


2017-06-15  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (add<mode>3): Use reg_or_subregno instead
	of REGNO.

---
 gcc/config/rs6000/rs6000.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index dedb2e3..8e1b460 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -1631,7 +1631,7 @@ (define_expand "add<mode>3"
 
       /* Adding a constant to r0 is not a valid insn, so use a different
 	 strategy in that case.  */
-      if (REGNO (operands[1]) == 0 || REGNO (tmp) == 0)
+      if (reg_or_subregno (operands[1]) == 0 || reg_or_subregno (tmp) == 0)
 	{
 	  if (operands[0] == operands[1])
 	    FAIL;
-- 
1.9.3


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