0008-shsibcall.diff 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. --- a/gcc/config/sh/sh.md
  2. +++ b/gcc/config/sh/sh.md
  3. @@ -10476,7 +10476,7 @@
  4. (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" ""))
  5. (match_operand 2 "" "")))
  6. (use (reg:SI FPSCR_MODES_REG))
  7. - (clobber (match_scratch:SI 3 "=&k"))
  8. + (clobber (reg:SI R1_REG))
  9. (return)]
  10. "TARGET_SH2 && !TARGET_FDPIC"
  11. "#"
  12. @@ -10491,6 +10495,8 @@
  13. rtx lab = PATTERN (gen_call_site ());
  14. rtx call_insn;
  15. + operands[3] = gen_rtx_REG (SImode, R1_REG);
  16. +
  17. sh_expand_sym_label2reg (operands[3], operands[1], lab, true);
  18. call_insn = emit_call_insn (gen_sibcall_valuei_pcrel (operands[0],
  19. operands[3],
  20. @@ -10511,7 +10519,7 @@
  21. (match_operand 2)))
  22. (use (reg:SI FPSCR_MODES_REG))
  23. (use (reg:SI PIC_REG))
  24. - (clobber (match_scratch:SI 3 "=k"))
  25. + (clobber (reg:SI R1_REG))
  26. (return)]
  27. "TARGET_SH2 && TARGET_FDPIC"
  28. "#"
  29. @@ -10520,6 +10528,8 @@
  30. {
  31. rtx lab = PATTERN (gen_call_site ());
  32. + operands[3] = gen_rtx_REG (SImode, R1_REG);
  33. +
  34. sh_expand_sym_label2reg (operands[3], operands[1], lab, true);
  35. rtx i = emit_call_insn (gen_sibcall_valuei_pcrel_fdpic (operands[0],
  36. operands[3],