Bug 247129 - Add support to gcc to work around R10K errata
Bug#: 247129 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: toolchain@gentoo.org Reported By: kumba@gentoo.org
Component: Development
URL: 
Summary: Add support to gcc to work around R10K errata
Keywords:  
Status Whiteboard: 
Opened: 2008-11-17 01:48 0000
Description:   Opened: 2008-11-17 01:48 0000
Got this patch submitted to upstream, and I've since backported it to 4.3.2. 
Tested on a cross-compiler, which builds fine, and built a kernel with it
(although, the kernel has its own workarounds anyways).

Option is implied by default if --march=r10000, else by specifying
-mfix-r10000.  Cannot be used with -march=mips1, since it relies on
branch-likely instructions (beql, beqzl) being available, and those were
introduced in the MIPS-II ISA specification.  It was decided in the patch
discussion on gcc-patches that we would not implement the workaround for MIPS-I
binaries (which involves substituting in 28 nops after the branch), because
most modern binaries that run on R10K processors are either n32 MIPS-IV (Irix
6.x) or o32 MIPS-II (Irix 5.x, Debian stable, and Gentoo) minimum.

Start of discussion:
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg01332.html

Final Patch committed to upstream:
http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00707.html

------- Comment #1 From Joshua Kinard 2008-11-17 01:48:42 0000 -------
Created an attachment (id=172037) [details]
Add -mfix-r10000 support to gcc 4.3.x

------- Comment #2 From Mark Loeser 2008-11-23 18:26:24 0000 -------
Thanks.  In the newest patchset.