diff mbox

[committed,SH] Fix PR target/67573

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

Commit Message

Kaz Kojima Sept. 17, 2015, 12:15 a.m. UTC
I've committed the attached patch to fix PR67573.  LRA reveals
that scratch registers in *call_*pcrel should be defined as
early clobbered.  The patch is tested on sh4-unkown-linux-gnu.

Regards,
	kaz
--
2015-09-16  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR target/67573
	* config/sh/sh.md (call_pcrel): Add early clobber to scratch
	operand.
	(call_value_pcrel, sibcall_pcrel, sibcall_value_pcrel): Likewise.

Comments

Kaz Kojima Sept. 20, 2015, 11:56 p.m. UTC | #1
> I've committed the attached patch to fix PR67573.  LRA reveals
> that scratch registers in *call_*pcrel should be defined as
> early clobbered.  The patch is tested on sh4-unkown-linux-gnu.

I backported the fix for PR target/67573 to 5-branch.  The trunk
patch applies without problem.  Tested on sh4-unknown-linux-gnu.
Committed as revision 227953.

Regards,
	kaz
--
2015-09-21  Kaz Kojima  <kkojima@gcc.gnu.org>

	Backport from mainline
	2015-09-16  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR target/67573
	* config/sh/sh.md (call_pcrel): Add early clobber to scratch
	operand.
	(call_value_pcrel, sibcall_pcrel, sibcall_value_pcrel): Likewise.
diff mbox

Patch

diff --git a/config/sh/sh.md b/config/sh/sh.md
index 4e7cd16..659c4c7 100644
--- a/config/sh/sh.md
+++ b/config/sh/sh.md
@@ -9464,7 +9464,7 @@  label:
    (use (reg:SI FPSCR_MODES_REG))
    (use (reg:SI PIC_REG))
    (clobber (reg:SI PR_REG))
-   (clobber (match_scratch:SI 2 "=r"))]
+   (clobber (match_scratch:SI 2 "=&r"))]
   "TARGET_SH2"
   "#"
   "reload_completed"
@@ -9595,7 +9595,7 @@  label:
    (use (reg:SI FPSCR_MODES_REG))
    (use (reg:SI PIC_REG))
    (clobber (reg:SI PR_REG))
-   (clobber (match_scratch:SI 3 "=r"))]
+   (clobber (match_scratch:SI 3 "=&r"))]
   "TARGET_SH2"
   "#"
   "reload_completed"
@@ -9993,7 +9993,7 @@  label:
   [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" ""))
 	 (match_operand 1 "" ""))
    (use (reg:SI FPSCR_MODES_REG))
-   (clobber (match_scratch:SI 2 "=k"))
+   (clobber (match_scratch:SI 2 "=&k"))
    (return)]
   "TARGET_SH2"
   "#"
@@ -10185,7 +10185,7 @@  label:
 	(call (mem:SI (match_operand:SI 1 "symbol_ref_operand" ""))
 	      (match_operand 2 "" "")))
    (use (reg:SI FPSCR_MODES_REG))
-   (clobber (match_scratch:SI 3 "=k"))
+   (clobber (match_scratch:SI 3 "=&k"))
    (return)]
   "TARGET_SH2"
   "#"