aboutsummaryrefslogtreecommitdiff
path: root/4.8.4
diff options
context:
space:
mode:
authorMagnus Granberg <zorry@gentoo.org>2015-02-19 20:32:36 +0000
committerMagnus Granberg <zorry@gentoo.org>2015-02-19 20:32:36 +0000
commit90b590935f1c3504ebf256103dfb30be807fa200 (patch)
treebf50a9a232c9d79ab011577c2798fb69764b907d /4.8.4
parentAdd 20_all_msgfmt-libstdc++-link.patch from 4.7.4 to 4.8.4 and 4.9.2 (diff)
downloadgcc-patches-90b590935f1c3504ebf256103dfb30be807fa200.tar.gz
gcc-patches-90b590935f1c3504ebf256103dfb30be807fa200.tar.bz2
gcc-patches-90b590935f1c3504ebf256103dfb30be807fa200.zip
Bump gentoo gcc patchset for 4.8.4 and 4.9.2 to 1.2 for mips bug 516548
Diffstat (limited to '4.8.4')
-rw-r--r--4.8.4/gentoo/91_all_pr61538-atomic-compare-exchange.patch58
-rw-r--r--4.8.4/gentoo/README.history3
2 files changed, 61 insertions, 0 deletions
diff --git a/4.8.4/gentoo/91_all_pr61538-atomic-compare-exchange.patch b/4.8.4/gentoo/91_all_pr61538-atomic-compare-exchange.patch
new file mode 100644
index 0000000..fb7f348
--- /dev/null
+++ b/4.8.4/gentoo/91_all_pr61538-atomic-compare-exchange.patch
@@ -0,0 +1,58 @@
+2015-02-19 Joshua Kinard <kumba@gentoo.org>
+
+ Fix __atomic_* builtins broken on R10000-based MIPS systems
+ PR61538 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61538
+ Bug 516548 https://bugs.gentoo.org/516548
+
+--- a/gcc/config/mips/mips.c 2014-03-08 04:27:23.000000000 -0500
++++ b/gcc/config/mips/mips.c 2015-02-18 06:30:22.365154629 -0500
+@@ -12867,7 +12867,14 @@ mips_process_sync_loop (rtx insn, rtx *o
+ This will sometimes be a delayed branch; see the write code below
+ for details. */
+ mips_multi_add_insn (is_64bit_p ? "scd\t%0,%1" : "sc\t%0,%1", at, mem, NULL);
+- mips_multi_add_insn ("beq%?\t%0,%.,1b", at, NULL);
++
++ /* When using branch likely (-mfix-r10000), the delay slot instruction
++ will be annulled on false. The normal delay slot instructions
++ calculate the overall result of the atomic operation and must not
++ be annulled. To ensure this behaviour unconditionally use a NOP
++ in the delay slot for the branch likely case. */
++
++ mips_multi_add_insn ("beq%?\t%0,%.,1b%~", at, NULL);
+
+ /* if (INSN1 != MOVE && INSN1 != LI) NEWVAL = $TMP3 [delay slot]. */
+ if (insn1 != SYNC_INSN1_MOVE && insn1 != SYNC_INSN1_LI && tmp3 != newval)
+@@ -12875,7 +12882,7 @@ mips_process_sync_loop (rtx insn, rtx *o
+ mips_multi_copy_insn (tmp3_insn);
+ mips_multi_set_operand (mips_multi_last_index (), 0, newval);
+ }
+- else if (!(required_oldval && cmp))
++ else if (!(required_oldval && cmp) && !mips_branch_likely)
+ mips_multi_add_insn ("nop", NULL);
+
+ /* CMP = 1 -- either standalone or in a delay slot. */
+@@ -12899,12 +12906,12 @@ mips_process_sync_loop (rtx insn, rtx *o
+ const char *
+ mips_output_sync_loop (rtx insn, rtx *operands)
+ {
+- mips_process_sync_loop (insn, operands);
+-
+ /* Use branch-likely instructions to work around the LL/SC R10000
+ errata. */
+ mips_branch_likely = TARGET_FIX_R10000;
+
++ mips_process_sync_loop (insn, operands);
++
+ mips_push_asm_switch (&mips_noreorder);
+ mips_push_asm_switch (&mips_nomacro);
+ mips_push_asm_switch (&mips_noat);
+@@ -12926,6 +12933,9 @@ mips_output_sync_loop (rtx insn, rtx *op
+ unsigned int
+ mips_sync_loop_insns (rtx insn, rtx *operands)
+ {
++ /* Use branch-likely instructions to work around the LL/SC R10000
++ errata. */
++ mips_branch_likely = TARGET_FIX_R10000;
+ mips_process_sync_loop (insn, operands);
+ return mips_multi_num_insns;
+ }
diff --git a/4.8.4/gentoo/README.history b/4.8.4/gentoo/README.history
index ecfe96e..33a7937 100644
--- a/4.8.4/gentoo/README.history
+++ b/4.8.4/gentoo/README.history
@@ -1,3 +1,6 @@
+1.2 19 Feb 2015
+ + 91_all_pr61538-atomic-compare-exchange.patch
+
1.1 09 Feb 2015
+ 20_all_msgfmt-libstdc++-link.patch