diff mbox

[SH] Fix PR target/62111

Message ID 20140825.093937.180311673.kkojima@rr.iij4u.or.jp
State New
Headers show

Commit Message

Kaz Kojima Aug. 25, 2014, 12:39 a.m. UTC
I've applied the attached patch to fix PR target/62111 which
is a sh64 specific 4.9/5 regression.
It seems that *zero_extendhisi2_media makes reload unhappy
with permitting (truncate (pseudo_reg)) when pseudo_reg can
be substituted by mem.  See

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62111

for details.  Tested on sh64-elf and sh4-unknown-linux-gnu with
no new failures.  I'll backport this to 4.9 in a week or so.

Regards,
	kaz
--
2014-08-25  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR target/62111
	* config/sh/predicates.md (general_extend_operand): Disable
	TRUNCATE before reload completes.
diff mbox

Patch

--- gcc/config/sh/predicates.md.orig	2014-08-02 11:55:29.228875715 +0900
+++ gcc/config/sh/predicates.md	2014-08-17 08:30:20.439326569 +0900
@@ -398,7 +398,7 @@ 
 (define_predicate "general_extend_operand"
   (match_code "subreg,reg,mem,truncate")
 {
-  if (GET_CODE (op) == TRUNCATE)
+  if (reload_completed && GET_CODE (op) == TRUNCATE)
     return arith_operand (op, mode);
 
   if (MEM_P (op) || (GET_CODE (op) == SUBREG && MEM_P (SUBREG_REG (op))))