From 69cadffdec9aa3575d0ff5fc363154569ea3d55f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 12 Feb 2016 05:35:23 +0000 Subject: [PATCH] add patch fixing sh sibcall bug that affected musl, remove workaround --- Makefile | 1 - patches/gcc-5.2.0/0008-shsibcall.diff | 39 +++++++++++++++++++++++++++ patches/musl-complex-hack | 2 -- 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 patches/gcc-5.2.0/0008-shsibcall.diff delete mode 100644 patches/musl-complex-hack diff --git a/Makefile b/Makefile index bccb15e..3daa48c 100644 --- a/Makefile +++ b/Makefile @@ -143,7 +143,6 @@ musl/.mcm_cloned: musl/.mcm_configured: musl/.mcm_cloned gcc-$(GCC_VER)/build0/.mcm_built cd musl && ./configure $(MUSL_CONFIG) - cat patches/musl-complex-hack >> musl/config.mak touch $@ musl/.mcm_built: musl/.mcm_configured diff --git a/patches/gcc-5.2.0/0008-shsibcall.diff b/patches/gcc-5.2.0/0008-shsibcall.diff new file mode 100644 index 0000000..48bd6fc --- /dev/null +++ b/patches/gcc-5.2.0/0008-shsibcall.diff @@ -0,0 +1,39 @@ +--- a/gcc/config/sh/sh.md (revision 233324) ++++ b/gcc/config/sh/sh.md (working copy) +@@ -10476,7 +10476,7 @@ + (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 (reg:SI R1_REG)) + (return)] + "TARGET_SH2 && !TARGET_FDPIC" + "#" +@@ -10491,6 +10495,8 @@ + rtx lab = PATTERN (gen_call_site ()); + rtx call_insn; + ++ operands[3] = gen_rtx_REG (SImode, R1_REG); ++ + sh_expand_sym_label2reg (operands[3], operands[1], lab, true); + call_insn = emit_call_insn (gen_sibcall_valuei_pcrel (operands[0], + operands[3], +@@ -10511,7 +10519,7 @@ + (match_operand 2))) + (use (reg:SI FPSCR_MODES_REG)) + (use (reg:SI PIC_REG)) +- (clobber (match_scratch:SI 3 "=k")) ++ (clobber (reg:SI R1_REG)) + (return)] + "TARGET_SH2 && TARGET_FDPIC" + "#" +@@ -10520,6 +10528,8 @@ + { + rtx lab = PATTERN (gen_call_site ()); + ++ operands[3] = gen_rtx_REG (SImode, R1_REG); ++ + sh_expand_sym_label2reg (operands[3], operands[1], lab, true); + rtx i = emit_call_insn (gen_sibcall_valuei_pcrel_fdpic (operands[0], + operands[3], + diff --git a/patches/musl-complex-hack b/patches/musl-complex-hack deleted file mode 100644 index 9394dea..0000000 --- a/patches/musl-complex-hack +++ /dev/null @@ -1,2 +0,0 @@ -$(patsubst %.c,%.o,$(wildcard src/complex/*.c)): CFLAGS += -fno-optimize-sibling-calls -$(patsubst %.c,%.lo,$(wildcard src/complex/*.c)): CFLAGS += -fno-optimize-sibling-calls