Skip to content

Instantly share code, notes, and snippets.

@FlyGoat
Created December 27, 2018 07:12
Show Gist options
  • Save FlyGoat/5d4b12a0dd8afd0479183df602f3fd8e to your computer and use it in GitHub Desktop.
Save FlyGoat/5d4b12a0dd8afd0479183df602f3fd8e to your computer and use it in GitHub Desktop.
gcc_mno-unaligned-access.patch
diff -Nur gcc-8.2.0/gcc/config/mips/mips.h gcc-8.2.0-fg/gcc/config/mips/mips.h
--- gcc-8.2.0/gcc/config/mips/mips.h 2018-01-03 18:03:58.000000000 +0800
+++ gcc-8.2.0-fg/gcc/config/mips/mips.h 2018-12-27 15:03:01.526649000 +0800
@@ -1105,7 +1105,7 @@
&& (MODE) == V2SFmode)) \
&& !TARGET_MIPS16)
-#define ISA_HAS_LWL_LWR (mips_isa_rev <= 5 && !TARGET_MIPS16)
+#define ISA_HAS_LWL_LWR (mips_isa_rev <= 5 && !TARGET_MIPS16 && !TARGET_NO_UNALIGNED_ACCESS)
#define ISA_HAS_IEEE_754_LEGACY (mips_isa_rev <= 5)
diff -Nur gcc-8.2.0/gcc/config/mips/mips.opt gcc-8.2.0-fg/gcc/config/mips/mips.opt
--- gcc-8.2.0/gcc/config/mips/mips.opt 2018-01-03 18:03:58.000000000 +0800
+++ gcc-8.2.0-fg/gcc/config/mips/mips.opt 2018-12-27 15:02:03.936568000 +0800
@@ -307,6 +307,10 @@
Target Report Var(TARGET_MT)
Allow the use of MT instructions.
+mno-unaligned-access
+Target Report RejectNegative Var(TARGET_NO_UNALIGNED_ACCESS)
+Prevent the use of LWL, LWR, SWL and SWR.
+
mno-float
Target Report RejectNegative Var(TARGET_NO_FLOAT) Condition(TARGET_SUPPORTS_NO_FLOAT)
Prevent the use of all floating-point operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment