diff options
Diffstat (limited to 'package/gcc')
12 files changed, 627 insertions, 6 deletions
diff --git a/package/gcc/4.8.5/0001-ARM-PR-target-68059-libgcc-should-not-use-__write-fo.patch b/package/gcc/4.8.5/0001-ARM-PR-target-68059-libgcc-should-not-use-__write-fo.patch new file mode 100644 index 0000000000..d8c6723ed3 --- /dev/null +++ b/package/gcc/4.8.5/0001-ARM-PR-target-68059-libgcc-should-not-use-__write-fo.patch @@ -0,0 +1,43 @@ +From edb9057c195c41dd7bcd8603e5fd420359edd520 Mon Sep 17 00:00:00 2001 +From: nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Mon, 23 Nov 2015 15:17:55 +0000 +Subject: [PATCH] [ARM] PR target/68059 libgcc should not use __write for + printing fatal error + +libgcc/ + PR target/68059 + * config/arm/linux-atomic-64bit.c (__write): Rename to... + (write): ...this and fix the return type. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230762 138bc75d-0d04-0410-961f-82ee72b054a4 + +Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> +--- + libgcc/config/arm/linux-atomic-64bit.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libgcc/config/arm/linux-atomic-64bit.c b/libgcc/config/arm/linux-atomic-64bit.c +index 7aa8dfc..570b4ce 100644 +--- a/libgcc/config/arm/linux-atomic-64bit.c ++++ b/libgcc/config/arm/linux-atomic-64bit.c +@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + kernels; we check for that in an init section and bail out rather + unceremoneously. */ + +-extern unsigned int __write (int fd, const void *buf, unsigned int count); ++extern int write (int fd, const void *buf, unsigned int count); + extern void abort (void); + + /* Kernel helper for compare-and-exchange. */ +@@ -56,7 +56,7 @@ static void __check_for_sync8_kernelhelper (void) + for the user - I'm not sure I can rely on much else being + available at this point, so do the same as generic-morestack.c + write () and abort (). */ +- __write (2 /* stderr. */, err, sizeof (err)); ++ write (2 /* stderr. */, err, sizeof (err)); + abort (); + } + }; +-- +2.10.2 + diff --git a/package/gcc/4.9.4/0001-ARM-PR-target-68059-libgcc-should-not-use-__write-fo.patch b/package/gcc/4.9.4/0001-ARM-PR-target-68059-libgcc-should-not-use-__write-fo.patch new file mode 100644 index 0000000000..fd2bc69538 --- /dev/null +++ b/package/gcc/4.9.4/0001-ARM-PR-target-68059-libgcc-should-not-use-__write-fo.patch @@ -0,0 +1,43 @@ +From 80bc14a5249da7054b716229206b453f339b4a5e Mon Sep 17 00:00:00 2001 +From: nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Mon, 23 Nov 2015 15:17:55 +0000 +Subject: [PATCH] [ARM] PR target/68059 libgcc should not use __write for + printing fatal error + +libgcc/ + PR target/68059 + * config/arm/linux-atomic-64bit.c (__write): Rename to... + (write): ...this and fix the return type. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230762 138bc75d-0d04-0410-961f-82ee72b054a4 + +Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> +--- + libgcc/config/arm/linux-atomic-64bit.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libgcc/config/arm/linux-atomic-64bit.c b/libgcc/config/arm/linux-atomic-64bit.c +index 5b8c6e2..9078673 100644 +--- a/libgcc/config/arm/linux-atomic-64bit.c ++++ b/libgcc/config/arm/linux-atomic-64bit.c +@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + kernels; we check for that in an init section and bail out rather + unceremoneously. */ + +-extern unsigned int __write (int fd, const void *buf, unsigned int count); ++extern int write (int fd, const void *buf, unsigned int count); + extern void abort (void); + + /* Kernel helper for compare-and-exchange. */ +@@ -56,7 +56,7 @@ static void __check_for_sync8_kernelhelper (void) + for the user - I'm not sure I can rely on much else being + available at this point, so do the same as generic-morestack.c + write () and abort (). */ +- __write (2 /* stderr. */, err, sizeof (err)); ++ write (2 /* stderr. */, err, sizeof (err)); + abort (); + } + }; +-- +2.10.2 + diff --git a/package/gcc/5.4.0/875-xtensa-implement-trap-pattern.patch b/package/gcc/5.4.0/875-xtensa-implement-trap-pattern.patch new file mode 100644 index 0000000000..870b079e38 --- /dev/null +++ b/package/gcc/5.4.0/875-xtensa-implement-trap-pattern.patch @@ -0,0 +1,67 @@ +From 2b4b5775554c91a63ccae4ee566db696b633652e Mon Sep 17 00:00:00 2001 +From: jcmvbkbc <jcmvbkbc@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Wed, 10 Jun 2015 15:07:40 +0000 +Subject: [PATCH] xtensa: implement trap pattern + +2015-06-10 Max Filippov <jcmvbkbc@gmail.com> +gcc/ + * config/xtensa/xtensa.h (TARGET_DEBUG): New definition. + * config/xtensa/xtensa.md (define_attr "type"): New type "trap". + (define_insn "trap"): New definition. + +Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224330 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/config/xtensa/xtensa.h | 1 + + gcc/config/xtensa/xtensa.md | 15 ++++++++++++++- + 2 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h +index 615f741..fb8702c 100644 +--- a/gcc/config/xtensa/xtensa.h ++++ b/gcc/config/xtensa/xtensa.h +@@ -67,6 +67,7 @@ extern unsigned xtensa_current_frame_size; + #define TARGET_THREADPTR XCHAL_HAVE_THREADPTR + #define TARGET_LOOPS XCHAL_HAVE_LOOPS + #define TARGET_WINDOWED_ABI (XSHAL_ABI == XTHAL_ABI_WINDOWED) ++#define TARGET_DEBUG XCHAL_HAVE_DEBUG + + #define TARGET_DEFAULT \ + ((XCHAL_HAVE_L32R ? 0 : MASK_CONST16) | \ +diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md +index 6d84384..a577aa3 100644 +--- a/gcc/config/xtensa/xtensa.md ++++ b/gcc/config/xtensa/xtensa.md +@@ -86,7 +86,7 @@ + ;; Attributes. + + (define_attr "type" +- "unknown,jump,call,load,store,move,arith,multi,nop,farith,fmadd,fconv,fload,fstore,mul16,mul32,div32,mac16,rsr,wsr,entry" ++ "unknown,jump,call,load,store,move,arith,multi,nop,farith,fmadd,fconv,fload,fstore,mul16,mul32,div32,mac16,rsr,wsr,entry,trap" + (const_string "unknown")) + + (define_attr "mode" +@@ -1764,6 +1764,19 @@ + [(set_attr "length" "0") + (set_attr "type" "nop")]) + ++(define_insn "trap" ++ [(trap_if (const_int 1) (const_int 0))] ++ "" ++{ ++ if (TARGET_DEBUG) ++ return "break\t1, 15"; ++ else ++ return (TARGET_DENSITY ? "ill.n" : "ill"); ++} ++ [(set_attr "type" "trap") ++ (set_attr "mode" "none") ++ (set_attr "length" "3")]) ++ + ;; Setting up a frame pointer is tricky for Xtensa because GCC doesn't + ;; know if a frame pointer is required until the reload pass, and + ;; because there may be an incoming argument value in the hard frame +-- +2.1.4 + diff --git a/package/gcc/5.4.0/876-xtensa-Fix-PR-target-78603.patch b/package/gcc/5.4.0/876-xtensa-Fix-PR-target-78603.patch new file mode 100644 index 0000000000..628268ada4 --- /dev/null +++ b/package/gcc/5.4.0/876-xtensa-Fix-PR-target-78603.patch @@ -0,0 +1,37 @@ +From e178289a12a829ec47dc5038d91401f65381e71d Mon Sep 17 00:00:00 2001 +From: Max Filippov <jcmvbkbc@gmail.com> +Date: Tue, 29 Nov 2016 13:09:17 -0800 +Subject: [PATCH 8/8] xtensa: Fix PR target/78603 + +2016-11-29 Max Filippov <jcmvbkbc@gmail.com> +gcc/ + * config/xtensa/xtensa.c (hwloop_optimize): Don't emit zero + overhead loop start between a call and its CALL_ARG_LOCATION + note. + +Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> +--- +Backported from: r242979 + + gcc/config/xtensa/xtensa.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c +index 206ff80..36ab1e3 100644 +--- a/gcc/config/xtensa/xtensa.c ++++ b/gcc/config/xtensa/xtensa.c +@@ -4182,7 +4182,10 @@ hwloop_optimize (hwloop_info loop) + entry_after = BB_END (entry_bb); + while (DEBUG_INSN_P (entry_after) + || (NOTE_P (entry_after) +- && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK)) ++ && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK ++ /* Make sure we don't split a call and its corresponding ++ CALL_ARG_LOCATION note. */ ++ && NOTE_KIND (entry_after) != NOTE_INSN_CALL_ARG_LOCATION)) + entry_after = PREV_INSN (entry_after); + + emit_insn_after (seq, entry_after); +-- +2.1.4 + diff --git a/package/gcc/5.4.0/911-ppc-musl-support.patch b/package/gcc/5.4.0/911-ppc-musl-support.patch new file mode 100644 index 0000000000..f4905a4232 --- /dev/null +++ b/package/gcc/5.4.0/911-ppc-musl-support.patch @@ -0,0 +1,75 @@ +Add support for musl on ppc32 + +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> + +diff -Nur gcc-5.4.0.orig/gcc/config/rs6000/sysv4.h gcc-5.4.0/gcc/config/rs6000/sysv4.h +--- gcc-5.4.0.orig/gcc/config/rs6000/sysv4.h 2015-09-24 15:46:45.000000000 +0200 ++++ gcc-5.4.0/gcc/config/rs6000/sysv4.h 2016-11-27 13:12:33.226953738 +0100 +@@ -537,6 +537,9 @@ + #ifndef CC1_SECURE_PLT_DEFAULT_SPEC + #define CC1_SECURE_PLT_DEFAULT_SPEC "" + #endif ++#ifndef LINK_SECURE_PLT_DEFAULT_SPEC ++#define LINK_SECURE_PLT_DEFAULT_SPEC "" ++#endif + + /* Pass -G xxx to the compiler. */ + #undef CC1_SPEC +@@ -757,17 +760,23 @@ + + #define LINK_START_LINUX_SPEC "" + ++#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","") ++ + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" ++#define MUSL_DYNAMIC_LINKER \ ++ "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" + #if DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" + #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" + #else + #error "Unsupported DEFAULT_LIBC" + #endif + #define GNU_USER_DYNAMIC_LINKER \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) + + #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ +@@ -889,6 +898,7 @@ + { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \ + { "link_os_default", LINK_OS_DEFAULT_SPEC }, \ + { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \ ++ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \ + { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ + { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ + { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ +diff -Nur gcc-5.4.0.orig/gcc/config/rs6000/sysv4le.h gcc-5.4.0/gcc/config/rs6000/sysv4le.h +--- gcc-5.4.0.orig/gcc/config/rs6000/sysv4le.h 2015-09-24 15:46:45.000000000 +0200 ++++ gcc-5.4.0/gcc/config/rs6000/sysv4le.h 2016-11-27 13:12:33.226953738 +0100 +@@ -31,3 +31,5 @@ + /* Little-endian PowerPC64 Linux uses the ELF v2 ABI by default. */ + #define LINUX64_DEFAULT_ABI_ELFv2 + ++#undef MUSL_DYNAMIC_LINKER_E ++#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","le") +diff -Nur gcc-5.4.0.orig/gcc/config.gcc gcc-5.4.0/gcc/config.gcc +--- gcc-5.4.0.orig/gcc/config.gcc 2015-09-10 16:17:53.000000000 +0200 ++++ gcc-5.4.0/gcc/config.gcc 2016-11-27 13:14:17.149638148 +0100 +@@ -2413,6 +2413,10 @@ + powerpc*-*-linux*paired*) + tm_file="${tm_file} rs6000/750cl.h" ;; + esac ++ case ${target} in ++ powerpc*-*-linux*-musl*) ++ enable_secureplt=yes ;; ++ esac + if test x${enable_secureplt} = xyes; then + tm_file="rs6000/secureplt.h ${tm_file}" + fi diff --git a/package/gcc/6.2.0/870-xtensa-Fix-PR-target-78118.patch b/package/gcc/6.2.0/870-xtensa-Fix-PR-target-78118.patch new file mode 100644 index 0000000000..0598c76c2f --- /dev/null +++ b/package/gcc/6.2.0/870-xtensa-Fix-PR-target-78118.patch @@ -0,0 +1,320 @@ +From 0d2556fa652cc85b3d042e862a38dd07d454175a Mon Sep 17 00:00:00 2001 +From: Max Filippov <jcmvbkbc@gmail.com> +Date: Wed, 26 Oct 2016 08:02:51 +0000 +Subject: [PATCH 1/2] xtensa: Fix PR target/78118 + +It started failing after the following commit: 32e90dc6a0cda45 ("PR +rtl-optimization/61047"). + +The change that made xtensa backend go ICE looks completely unrelated, +and indeed, the issue is caused by the side effect of +compute_frame_size() function call hidden in the +INITIAL_ELIMINATION_OFFSET macro. This call updates the value of the +xtensa_current_frame_size static variable, used in "return" instruction +predicate. Prior to the change the value of xtensa_current_frame_size was +set to 0 after the end of epilogue generation, which enabled the "return" +instruction for the CALL0 ABI, but after the change the additional +INITIAL_ELIMINATION_OFFSET calls make xtensa_current_frame_size non-zero +and "return" pattern unavailable. + +Get rid of the global xtensa_current_frame_size and +xtensa_callee_save_size variables by moving them into the +machine_function structure. Implement predicate for the "return" pattern +as a function. Don't communicate completion of epilogue generation +through zeroing of xtensa_current_frame_size, add explicit epilogue_done +variable to the machine_function structure. Don't update stack frame +layout after the completion of reload. + +2016-10-26 Max Filippov <jcmvbkbc@gmail.com> +gcc/ + * config/xtensa/xtensa-protos.h + (xtensa_use_return_instruction_p): New prototype. + * config/xtensa/xtensa.c (xtensa_current_frame_size, + xtensa_callee_save_size): Remove. + (struct machine_function): Add new fields: current_frame_size, + callee_save_size, frame_laid_out and epilogue_done. + (compute_frame_size, xtensa_expand_prologue, + xtensa_expand_epilogue): Replace xtensa_callee_save_size with + cfun->machine->callee_save_size and xtensa_current_frame_size + with cfun->machine->current_frame_size. + (compute_frame_size): Update cfun->machine->frame_laid_out and + don't update frame layout after reload completion. + (xtensa_expand_epilogue): Set cfun->machine->epilogue_done + instead of zeroing xtensa_current_frame_size. + (xtensa_use_return_instruction_p): New function. + * config/xtensa/xtensa.h (xtensa_current_frame_size): Remove + declaration. + (INITIAL_ELIMINATION_OFFSET): Use return value of + compute_frame_size instead of xtensa_current_frame_size value. + * config/xtensa/xtensa.md ("return" pattern): Use new predicate + function xtensa_use_return_instruction_p instead of inline code. + +Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> +--- +Backported from: r241748 + + gcc/config/xtensa/xtensa-protos.h | 1 + + gcc/config/xtensa/xtensa.c | 82 ++++++++++++++++++++++++--------------- + gcc/config/xtensa/xtensa.h | 6 +-- + gcc/config/xtensa/xtensa.md | 2 +- + 4 files changed, 55 insertions(+), 36 deletions(-) + +diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h +index f2ca526..873557f 100644 +--- a/gcc/config/xtensa/xtensa-protos.h ++++ b/gcc/config/xtensa/xtensa-protos.h +@@ -68,6 +68,7 @@ extern rtx xtensa_return_addr (int, rtx); + extern void xtensa_setup_frame_addresses (void); + extern int xtensa_dbx_register_number (int); + extern long compute_frame_size (int); ++extern bool xtensa_use_return_instruction_p (void); + extern void xtensa_expand_prologue (void); + extern void xtensa_expand_epilogue (void); + extern void order_regs_for_local_alloc (void); +diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c +index 64d089b..e49f784 100644 +--- a/gcc/config/xtensa/xtensa.c ++++ b/gcc/config/xtensa/xtensa.c +@@ -78,11 +78,6 @@ enum internal_test + can support a given mode. */ + char xtensa_hard_regno_mode_ok[(int) MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER]; + +-/* Current frame size calculated by compute_frame_size. */ +-unsigned xtensa_current_frame_size; +-/* Callee-save area size in the current frame calculated by compute_frame_size. */ +-int xtensa_callee_save_size; +- + /* Largest block move to handle in-line. */ + #define LARGEST_MOVE_RATIO 15 + +@@ -94,6 +89,13 @@ struct GTY(()) machine_function + bool vararg_a7; + rtx vararg_a7_copy; + rtx_insn *set_frame_ptr_insn; ++ /* Current frame size calculated by compute_frame_size. */ ++ unsigned current_frame_size; ++ /* Callee-save area size in the current frame calculated by ++ compute_frame_size. */ ++ int callee_save_size; ++ bool frame_laid_out; ++ bool epilogue_done; + }; + + /* Vector, indexed by hard register number, which contains 1 for a +@@ -2628,24 +2630,29 @@ compute_frame_size (int size) + { + int regno; + ++ if (reload_completed && cfun->machine->frame_laid_out) ++ return cfun->machine->current_frame_size; ++ + /* Add space for the incoming static chain value. */ + if (cfun->static_chain_decl != NULL) + size += (1 * UNITS_PER_WORD); + +- xtensa_callee_save_size = 0; ++ cfun->machine->callee_save_size = 0; + for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno) + { + if (xtensa_call_save_reg(regno)) +- xtensa_callee_save_size += UNITS_PER_WORD; ++ cfun->machine->callee_save_size += UNITS_PER_WORD; + } + +- xtensa_current_frame_size = ++ cfun->machine->current_frame_size = + XTENSA_STACK_ALIGN (size +- + xtensa_callee_save_size ++ + cfun->machine->callee_save_size + + crtl->outgoing_args_size + + (WINDOW_SIZE * UNITS_PER_WORD)); +- xtensa_callee_save_size = XTENSA_STACK_ALIGN (xtensa_callee_save_size); +- return xtensa_current_frame_size; ++ cfun->machine->callee_save_size = ++ XTENSA_STACK_ALIGN (cfun->machine->callee_save_size); ++ cfun->machine->frame_laid_out = true; ++ return cfun->machine->current_frame_size; + } + + +@@ -2696,6 +2703,7 @@ xtensa_expand_prologue (void) + { + int regno; + HOST_WIDE_INT offset = 0; ++ int callee_save_size = cfun->machine->callee_save_size; + + /* -128 is a limit of single addi instruction. */ + if (total_size > 0 && total_size <= 128) +@@ -2709,7 +2717,7 @@ xtensa_expand_prologue (void) + add_reg_note (insn, REG_FRAME_RELATED_EXPR, note_rtx); + offset = total_size - UNITS_PER_WORD; + } +- else if (xtensa_callee_save_size) ++ else if (callee_save_size) + { + /* 1020 is maximal s32i offset, if the frame is bigger than that + * we move sp to the end of callee-saved save area, save and then +@@ -2717,13 +2725,13 @@ xtensa_expand_prologue (void) + if (total_size > 1024) + { + insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, +- GEN_INT (-xtensa_callee_save_size))); ++ GEN_INT (-callee_save_size))); + RTX_FRAME_RELATED_P (insn) = 1; + note_rtx = gen_rtx_SET (stack_pointer_rtx, + plus_constant (Pmode, stack_pointer_rtx, +- -xtensa_callee_save_size)); ++ -callee_save_size)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, note_rtx); +- offset = xtensa_callee_save_size - UNITS_PER_WORD; ++ offset = callee_save_size - UNITS_PER_WORD; + } + else + { +@@ -2759,13 +2767,13 @@ xtensa_expand_prologue (void) + { + rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG); + emit_move_insn (tmp_reg, GEN_INT (total_size - +- xtensa_callee_save_size)); ++ callee_save_size)); + insn = emit_insn (gen_subsi3 (stack_pointer_rtx, + stack_pointer_rtx, tmp_reg)); + RTX_FRAME_RELATED_P (insn) = 1; + note_rtx = gen_rtx_SET (stack_pointer_rtx, + plus_constant (Pmode, stack_pointer_rtx, +- xtensa_callee_save_size - ++ callee_save_size - + total_size)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, note_rtx); + } +@@ -2833,21 +2841,21 @@ xtensa_expand_epilogue (void) + int regno; + HOST_WIDE_INT offset; + +- if (xtensa_current_frame_size > (frame_pointer_needed ? 127 : 1024)) ++ if (cfun->machine->current_frame_size > (frame_pointer_needed ? 127 : 1024)) + { + rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG); +- emit_move_insn (tmp_reg, GEN_INT (xtensa_current_frame_size - +- xtensa_callee_save_size)); ++ emit_move_insn (tmp_reg, GEN_INT (cfun->machine->current_frame_size - ++ cfun->machine->callee_save_size)); + emit_insn (gen_addsi3 (stack_pointer_rtx, frame_pointer_needed ? + hard_frame_pointer_rtx : stack_pointer_rtx, + tmp_reg)); +- offset = xtensa_callee_save_size - UNITS_PER_WORD; ++ offset = cfun->machine->callee_save_size - UNITS_PER_WORD; + } + else + { + if (frame_pointer_needed) + emit_move_insn (stack_pointer_rtx, hard_frame_pointer_rtx); +- offset = xtensa_current_frame_size - UNITS_PER_WORD; ++ offset = cfun->machine->current_frame_size - UNITS_PER_WORD; + } + + /* Prevent reordering of saved a0 update and loading it back from +@@ -2867,16 +2875,16 @@ xtensa_expand_epilogue (void) + } + } + +- if (xtensa_current_frame_size > 0) ++ if (cfun->machine->current_frame_size > 0) + { + if (frame_pointer_needed || /* always reachable with addi */ +- xtensa_current_frame_size > 1024 || +- xtensa_current_frame_size <= 127) ++ cfun->machine->current_frame_size > 1024 || ++ cfun->machine->current_frame_size <= 127) + { +- if (xtensa_current_frame_size <= 127) +- offset = xtensa_current_frame_size; ++ if (cfun->machine->current_frame_size <= 127) ++ offset = cfun->machine->current_frame_size; + else +- offset = xtensa_callee_save_size; ++ offset = cfun->machine->callee_save_size; + + emit_insn (gen_addsi3 (stack_pointer_rtx, + stack_pointer_rtx, +@@ -2885,7 +2893,8 @@ xtensa_expand_epilogue (void) + else + { + rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG); +- emit_move_insn (tmp_reg, GEN_INT (xtensa_current_frame_size)); ++ emit_move_insn (tmp_reg, ++ GEN_INT (cfun->machine->current_frame_size)); + emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, + tmp_reg)); + } +@@ -2896,11 +2905,22 @@ xtensa_expand_epilogue (void) + stack_pointer_rtx, + EH_RETURN_STACKADJ_RTX)); + } +- xtensa_current_frame_size = 0; +- xtensa_callee_save_size = 0; ++ cfun->machine->epilogue_done = true; + emit_jump_insn (gen_return ()); + } + ++bool ++xtensa_use_return_instruction_p (void) ++{ ++ if (!reload_completed) ++ return false; ++ if (TARGET_WINDOWED_ABI) ++ return true; ++ if (compute_frame_size (get_frame_size ()) == 0) ++ return true; ++ return cfun->machine->epilogue_done; ++} ++ + void + xtensa_set_return_address (rtx address, rtx scratch) + { +diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h +index 82e9900..58eb1b2 100644 +--- a/gcc/config/xtensa/xtensa.h ++++ b/gcc/config/xtensa/xtensa.h +@@ -23,8 +23,6 @@ along with GCC; see the file COPYING3. If not see + + /* External variables defined in xtensa.c. */ + +-extern unsigned xtensa_current_frame_size; +- + /* Macros used in the machine description to select various Xtensa + configuration options. */ + #ifndef XCHAL_HAVE_MUL32_HIGH +@@ -477,14 +475,14 @@ enum reg_class + /* Specify the initial difference between the specified pair of registers. */ + #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ + do { \ +- compute_frame_size (get_frame_size ()); \ ++ long frame_size = compute_frame_size (get_frame_size ()); \ + switch (FROM) \ + { \ + case FRAME_POINTER_REGNUM: \ + (OFFSET) = 0; \ + break; \ + case ARG_POINTER_REGNUM: \ +- (OFFSET) = xtensa_current_frame_size; \ ++ (OFFSET) = frame_size; \ + break; \ + default: \ + gcc_unreachable (); \ +diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md +index db54a12..fcdb6c8 100644 +--- a/gcc/config/xtensa/xtensa.md ++++ b/gcc/config/xtensa/xtensa.md +@@ -1663,7 +1663,7 @@ + (define_insn "return" + [(return) + (use (reg:SI A0_REG))] +- "(TARGET_WINDOWED_ABI || !xtensa_current_frame_size) && reload_completed" ++ "xtensa_use_return_instruction_p ()" + { + return TARGET_WINDOWED_ABI ? + (TARGET_DENSITY ? "retw.n" : "retw") : +-- +2.1.4 + diff --git a/package/gcc/6.2.0/871-xtensa-Fix-PR-target-78603.patch b/package/gcc/6.2.0/871-xtensa-Fix-PR-target-78603.patch new file mode 100644 index 0000000000..0331814398 --- /dev/null +++ b/package/gcc/6.2.0/871-xtensa-Fix-PR-target-78603.patch @@ -0,0 +1,37 @@ +From 59cce7b304a8cbbb508ba21ab2f9052d3ee9a9e3 Mon Sep 17 00:00:00 2001 +From: Max Filippov <jcmvbkbc@gmail.com> +Date: Tue, 29 Nov 2016 13:09:17 -0800 +Subject: [PATCH 2/2] xtensa: Fix PR target/78603 + +2016-11-29 Max Filippov <jcmvbkbc@gmail.com> +gcc/ + * config/xtensa/xtensa.c (hwloop_optimize): Don't emit zero + overhead loop start between a call and its CALL_ARG_LOCATION + note. + +Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> +--- +Backported from: r242979 + + gcc/config/xtensa/xtensa.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c +index e49f784..70f698a 100644 +--- a/gcc/config/xtensa/xtensa.c ++++ b/gcc/config/xtensa/xtensa.c +@@ -4158,7 +4158,10 @@ hwloop_optimize (hwloop_info loop) + entry_after = BB_END (entry_bb); + while (DEBUG_INSN_P (entry_after) + || (NOTE_P (entry_after) +- && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK)) ++ && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK ++ /* Make sure we don't split a call and its corresponding ++ CALL_ARG_LOCATION note. */ ++ && NOTE_KIND (entry_after) != NOTE_INSN_CALL_ARG_LOCATION)) + entry_after = PREV_INSN (entry_after); + + emit_insn_after (seq, entry_after); +-- +2.1.4 + diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host index 446df4dc78..d10798b10d 100644 --- a/package/gcc/Config.in.host +++ b/package/gcc/Config.in.host @@ -64,9 +64,8 @@ choice # musl ppc64 unsupported depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_powerpc64 || BR2_powerpc64el)) # Unsupported MIPS cores - depends on !BR2_mips_interaptiv && !BR2_mips_m5100 && \ - !BR2_mips_m5101 && !BR2_mips_m6201 && !BR2_mips_i6400 && \ - !BR2_mips_p6600 + depends on !BR2_mips_interaptiv && !BR2_mips_m5150 && \ + !BR2_mips_m6250 && !BR2_mips_i6400 && !BR2_mips_p6600 # musl mips64 unsupported depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_mips64 || BR2_mips64el)) select BR2_TOOLCHAIN_GCC_AT_LEAST_5 @@ -77,7 +76,7 @@ choice depends on !BR2_arc depends on !BR2_microblaze # Unsupported MIPS cores - depends on !BR2_mips_m6201 && !BR2_mips_p6600 + depends on !BR2_mips_m6250 && !BR2_mips_p6600 select BR2_TOOLCHAIN_GCC_AT_LEAST_6 endchoice @@ -99,7 +98,7 @@ config BR2_GCC_VERSION default "4.9.4" if BR2_GCC_VERSION_4_9_X default "5.4.0" if BR2_GCC_VERSION_5_X default "6.2.0" if BR2_GCC_VERSION_6_X - default "arc-2016.09-eng015" if BR2_GCC_VERSION_ARC + default "arc-2016.09-rc1" if BR2_GCC_VERSION_ARC config BR2_EXTRA_GCC_CONFIG_OPTIONS string "Additional gcc options" diff --git a/package/gcc/arc-2016.09-eng015/301-missing-execinfo_h.patch b/package/gcc/arc-2016.09-rc1/301-missing-execinfo_h.patch index 2d0e7baa44..2d0e7baa44 100644 --- a/package/gcc/arc-2016.09-eng015/301-missing-execinfo_h.patch +++ b/package/gcc/arc-2016.09-rc1/301-missing-execinfo_h.patch diff --git a/package/gcc/arc-2016.09-eng015/860-cilk-wchar.patch b/package/gcc/arc-2016.09-rc1/860-cilk-wchar.patch index 1d9916f554..1d9916f554 100644 --- a/package/gcc/arc-2016.09-eng015/860-cilk-wchar.patch +++ b/package/gcc/arc-2016.09-rc1/860-cilk-wchar.patch diff --git a/package/gcc/arc-2016.09-eng015/940-uclinux-enable-threads.patch b/package/gcc/arc-2016.09-rc1/940-uclinux-enable-threads.patch index 5532656725..5532656725 100644 --- a/package/gcc/arc-2016.09-eng015/940-uclinux-enable-threads.patch +++ b/package/gcc/arc-2016.09-rc1/940-uclinux-enable-threads.patch diff --git a/package/gcc/gcc.hash b/package/gcc/gcc.hash index ce738ef531..e5d96f44ad 100644 --- a/package/gcc/gcc.hash +++ b/package/gcc/gcc.hash @@ -12,4 +12,4 @@ sha512 2941cc950c8f2409a314df497631f9b0266211aa74746c1839c46e04f1c7c299afe2528d sha512 1e8b826a3d44b9d5899309894e20c03abeb352bf3d273b8ad63af814c0ee2911f1a83ce1cd4cdd2d1cb0b3e3c34e9b7ae1b2ab83dfc649ee817ab05247c76198 gcc-6.2.0.tar.bz2 # Locally calculated (fetched from Github) -sha512 9f365452f746ae91875d935c2ec5ed16cd11a2973f69bd23193fec9fc6b557e0dd66bb169e7efb7ec63fd78af36139005abcf5a5a1d89d6f49788b2ed7b334fb gcc-arc-2016.09-eng015.tar.gz +sha512 7029d7ae1316b9385880f32283aa6c4979b1257500bb21e3fb234475ecb20082f46b114d8b7022c75a8dcf0c0c7b6b02e9384b49dd3189adc3d454502b8b0c26 gcc-arc-2016.09-rc1.tar.gz |