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]

[PowerPC] Fix PR24954 ICE: could not split insn


I'll be applying the following as obvious to trunk and 4.1 when my
bootstrap and regression tests finish.  (char) is not a good way to sign
extend a byte.

	PR target/24954
	* config/rs6000/predicated.md (easy_vector_constant_add_self): Use
	explicit sign extension, not a (char) cast.

Index: gcc/config/rs6000/predicates.md
===================================================================
--- gcc/config/rs6000/predicates.md	(revision 107350)
+++ gcc/config/rs6000/predicates.md	(working copy)
@@ -317,7 +317,7 @@
 	    (match_test "easy_altivec_constant (op, mode)")))
 {
   rtx last = CONST_VECTOR_ELT (op, GET_MODE_NUNITS (mode) - 1);
-  HOST_WIDE_INT val = (char) (INTVAL (last) & 255);
+  HOST_WIDE_INT val = ((INTVAL (last) & 0xff) ^ 0x7f) - 0x7f;
   return EASY_VECTOR_15_ADD_SELF (val);
 })
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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