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 <kkoj...@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 --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" "#"