Fixed line endings in gcc-3.4.2-mips-ip28_cache_barriers-v2.patch
authorStuart Longland <redhatter@gentoo.org>
Fri, 16 Sep 2005 13:01:45 +0000 (13:01 +0000)
committerStuart Longland <redhatter@gentoo.org>
Fri, 16 Sep 2005 13:01:45 +0000 (13:01 +0000)
Package-Manager: portage-2.0.51.19

sys-devel/gcc/Manifest
sys-devel/gcc/files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v2.patch

index cb5e81229a5a711c7e261bfb73075a72bed2c8bb..99b0d8c6be8ca967ef204da5b61c72dfce08b4b3 100644 (file)
@@ -1,6 +1,3 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
 MD5 671ecb9dd6d798154032a7085f1398ab ChangeLog 93667
 MD5 3196c90905902891b12b4d08372c0eb5 gcc-2.95.3-r9.ebuild 7524
 MD5 37f3db1694d592dc3a3db07507390b76 gcc-3.1.1-r2.ebuild 9270
@@ -14,10 +11,10 @@ MD5 dee257c0fea166229acee12767e65236 gcc-3.3.6.ebuild 3037
 MD5 22583bfbc351f0715fefcf199efa7c79 gcc-3.4.1-r3.ebuild 31176
 MD5 8ad652a1c6c3b0b27963da2a8684dfc7 gcc-3.4.3-r1.ebuild 5429
 MD5 f3320fc6b7547238588e8d01266c7d1c gcc-3.4.3.20050110-r2.ebuild 5192
-MD5 f5804f3b322c22138f87bca0b3b3a69c gcc-3.4.4-r1.ebuild 5010
+MD5 567094e03359ffc1c95af7356395228d metadata.xml 162
 MD5 040ce3a966ff6b910a65e218fdeb137f gcc-4.0.1.ebuild 1668
+MD5 f5804f3b322c22138f87bca0b3b3a69c gcc-3.4.4-r1.ebuild 5010
 MD5 fd103c9ed79442ab91f70289116c0e1b gcc-4.0.2_pre20050913.ebuild 1947
-MD5 567094e03359ffc1c95af7356395228d metadata.xml 162
 MD5 f7e7042c2ddf66e344b30cbc66ebaf73 files/cc 24
 MD5 80d122265d3062847a4a1b161abe1d26 files/cpp 24
 MD5 4ecf0f5cb735c81ca4b61a9c6db74269 files/digest-gcc-2.95.3-r9 139
@@ -32,26 +29,26 @@ MD5 bc84418435b24e5c06f80f819e35b6fb files/digest-gcc-3.3.6 453
 MD5 c6ea8a92bac6d2638c54c011f98bc5b8 files/digest-gcc-3.4.1-r3 442
 MD5 e76a453a41518cf6a73123fe128c716f files/digest-gcc-3.4.3-r1 607
 MD5 f0d6e8b1503f1745061639b642fb1911 files/digest-gcc-3.4.3.20050110-r2 616
-MD5 397fee475b161984702afab06d76767c files/digest-gcc-3.4.4-r1 450
-MD5 f0c74f849066ffaefe7d364d69a71961 files/digest-gcc-4.0.1 380
-MD5 f0c9bda00475b05ced0fa0141f18cccb files/digest-gcc-4.0.2_pre20050913 389
 MD5 1acd56209164ab837c5f91723434464e files/fix_libtool_files.sh 1712
 MD5 f80fd6ebeeea00d3e1649dfccdd85062 files/gcc-spec-env.patch 893
 MD5 8baffb486c75efe253bd2daa88daa7d6 files/gcc331_use_multilib.amd64.patch 352
 MD5 e3193bdffb435b77a21bfb504ff6f591 files/mkinfodir 7324
 MD5 ea2cf3df0d89a26d5fdc1a531176e395 files/pro-police-docs.patch 3287
 MD5 07b57d62aa1a8cd4d1cd37984ebe2053 files/scan_libgcc_linked_ssp.sh 861
+MD5 f0c74f849066ffaefe7d364d69a71961 files/digest-gcc-4.0.1 380
+MD5 397fee475b161984702afab06d76767c files/digest-gcc-3.4.4-r1 450
+MD5 f0c9bda00475b05ced0fa0141f18cccb files/digest-gcc-4.0.2_pre20050913 389
 MD5 8ec9b0352d226e4693cabffe0fa5bba6 files/3.2.1/gcc31-loop-load-final-value.patch 3324
 MD5 5e8f2122ef7f9ce187b0a0d50ac9d24a files/3.2.1/gcc32-arm-disable-mathf.patch 2229
 MD5 044a164462d9392aa67cde6f9fd5c1bc files/3.2.1/gcc32-arm-reload1-fix.patch 932
 MD5 38131a537835873acb08c415d27a013e files/3.2.1/gcc32-athlon-alignment.patch 509
 MD5 7978d1aaf6bae19163e83c110dec1b38 files/3.2.1/gcc32-sparc32-hack.patch 2192
 MD5 51719a174883702ef1851fac4cc79398 files/3.2.1/gcc32-strip-dotdot.patch 2071
-MD5 ed5b074a1d34f4b30a0b1d3928be57e3 files/3.2.2/gcc-3.2.2-cross-compile.patch 479
-MD5 9a67d782b2a574f77714b29675cbda62 files/3.2.2/gcc-3.2.2-no-COPYING-cross-compile.patch 1001
 MD5 17f15202b98a8dd84d0f4b67eff2d868 files/3.2.2/gcc32-pr7768.patch 1789
 MD5 9f5b59d7567b90894d8d32cf99f910cc files/3.2.2/gcc32-pr8213.patch 2036
 MD5 465eeaf6008c25dc69ff502dc2a9d8e0 files/3.2.2/gcc322-ggc_page-speedup.patch 872
+MD5 ed5b074a1d34f4b30a0b1d3928be57e3 files/3.2.2/gcc-3.2.2-cross-compile.patch 479
+MD5 9a67d782b2a574f77714b29675cbda62 files/3.2.2/gcc-3.2.2-no-COPYING-cross-compile.patch 1001
 MD5 52ef1426cb70a472182503502b768058 files/3.2.3/gcc-3.2.3-mergel-fix.patch 2749
 MD5 a3315d69ba1be0bc1518a75027896bf3 files/3.2.3/gcc-3.2.3-move-propolice-into-glibc.patch 3534
 MD5 1f4f8ca52d2dda4a5dc3a9b8f130841c files/3.2.3/gcc-323-propolice-version.patch 700
@@ -71,15 +68,14 @@ MD5 3210d5fd70806c44d4426c3dceebd480 files/3.3.3/gcc333_pre20040408-stack-size.p
 MD5 5fb5b49f3f16cc9e7e27e582c92ffa2f files/3.3.4/libffi-without-libgcj.patch 890
 MD5 7c29f54dd8d50385ac42fae65459c744 files/3.3.5/gcc-3.3.5-ffecom_gfrt_basictype-prototype.patch 538
 MD5 184cb0a87ee2fa0197dec6f4902ef4c8 files/3.3.5/gcc-3.3.5-no-COPYING-cross-compile.patch 1192
-MD5 c313cea9fdb0a3a796f7e869a471da80 files/3.3.6/gcc-3.3.6-cross-compile.patch 2018
-MD5 17b3190d64e34ed7709d022b326d08ae files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch 563
 MD5 4edccdf0b4f6dbbc9f7bc9370c255e0c files/3.4.0/gcc34-reiser4-fix.patch 587
+MD5 17b3190d64e34ed7709d022b326d08ae files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch 563
 MD5 cd770c23ece7458db5e6c5067f262ce0 files/3.4.1/gcc-3.4.1-glibc-is-native.patch 760
 MD5 7cb2138ac2df6f8674d19974e966a45b files/3.4.1/gcc-3.4.1-mips-n32only.patch 614
 MD5 aa8e15a63d797df37bbd4e489ed0267f files/3.4.1/gcc-3.4.1-mips-n64only.patch 614
 MD5 14fec2000fc63536d4cf22195e88e14f files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch 781
 MD5 a720c913b78bcfbd7f63319130fadd4a files/3.4.2/810-arm-bigendian-uclibc.patch 1139
-MD5 00cca5c6d608d147bf379a38fe3b2d45 files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v2.patch 14576
+MD5 1134e9dabbd6dfba1d91015851f02a2b files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v2.patch 14118
 MD5 b2922cfe76692e7d2b373a0a255f405e files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch 14248
 MD5 f2395cf0f72d870e263d0dcec18fdd67 files/3.4.2/gcc34-fix-sse2_pinsrw.patch 1268
 MD5 2c1ce849de55d8c81af4e081dbb2f5e4 files/3.4.2/gcc34-m32-no-sse2.patch 1058
@@ -97,10 +93,4 @@ MD5 053b213d6994cef2ad995aa516ed937a files/stubs/gcc-3.4-htb-stub.patch 722
 MD5 d71c91009df788366867cb67fc875d6d files/stubs/gcc-3.4-ssp-stub.patch 1068
 MD5 37e756238508fe9f9e2b9ba6a7ca67ca files/stubs/gcc-4.0-htb-stub.patch 722
 MD5 d71c91009df788366867cb67fc875d6d files/stubs/gcc-4.0-ssp-stub.patch 1068
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.2 (GNU/Linux)
-
-iD8DBQFDKaWKCRZPokWLroQRAq8MAJ9I4byJENFJLVkgpFjVc2tE3Uba+ACbBMtJ
-A7980yEmFK3ur2pv828vnFQ=
-=Z8Wi
------END PGP SIGNATURE-----
+MD5 c313cea9fdb0a3a796f7e869a471da80 files/3.3.6/gcc-3.3.6-cross-compile.patch 2018
index 1c85e05ff389aaf26e7ae1862854f07f3c903498..d91c9f2738d5fd2d8284b10e7f48e498b418f89d 100644 (file)
---- gcc-3.4.2/gcc/config/mips/mips.h   Thu Jul 15 02:42:47 2004\r
-+++ gcc-3.4.2/gcc/config/mips/mips.h   Sat Sep 18 00:41:48 2004\r
-@@ -122,6 +122,7 @@\r
- extern const char *mips_isa_string;   /* for -mips{1,2,3,4} */\r
- extern const char *mips_abi_string;   /* for -mabi={32,n32,64} */\r
- extern const char *mips_cache_flush_func;/* for -mflush-func= and -mno-flush-func */\r
-+extern const char *mips_ip28_cache_barrier;/* for -mip28-cache-barrier */\r
- extern int mips_string_length;                /* length of strings for mips16 */\r
- extern const struct mips_cpu_info mips_cpu_info_table[];\r
- extern const struct mips_cpu_info *mips_arch_info;\r
-@@ -333,6 +334,7 @@\r
- #define TARGET_MIPS9000             (mips_arch == PROCESSOR_R9000)\r
- #define TARGET_SB1                  (mips_arch == PROCESSOR_SB1)\r
- #define TARGET_SR71K                (mips_arch == PROCESSOR_SR71000)\r
-+#define TARGET_IP28                 (mips_ip28_cache_barrier != 0)\r
- \r
- /* Scheduling target defines.  */\r
- #define TUNE_MIPS3000               (mips_tune == PROCESSOR_R3000)\r
-@@ -752,6 +754,8 @@\r
-       N_("Don't call any cache flush functions"), 0},                 \\r
-   { "flush-func=", &mips_cache_flush_func,                            \\r
-       N_("Specify cache flush function"), 0},                         \\r
-+  { "ip28-cache-barrier", &mips_ip28_cache_barrier,                   \\r
-+      N_("Generate special cache barriers for SGI Indigo2 R10k"), 0}, \\r
- }\r
- \r
- /* This is meant to be redefined in the host dependent files.  */\r
-@@ -3448,3 +3452,11 @@\r
-       " TEXT_SECTION_ASM_OP);\r
- #endif\r
- #endif\r
-+\f\r
-+#define ASM_OUTPUT_R10K_CACHE_BARRIER(STREAM)         \\r
-+  fprintf (STREAM, "\tcache 0x14,0($sp)\t%s Cache Barrier\n", ASM_COMMENT_START)\r
-+\r
-+/*\r
-+ * mips.h     Thu Jul 15 02:42:47 2004\r
-+ * mips.h     Fri Sep 17 23:18:19 2004        ip28\r
-+ */\r
---- gcc-3.4.2/gcc/config/mips/mips.c   Wed Jul  7 21:21:10 2004\r
-+++ gcc-3.4.2/gcc/config/mips/mips.c   Fri Sep 17 23:33:44 2004\r
-@@ -502,6 +502,11 @@\r
- \r
- const char *mips_cache_flush_func = CACHE_FLUSH_FUNC;\r
- \r
-+/* Nonzero means generate special cache barriers to inhibit speculative\r
-+   stores which might endanger cache coherency or reference invalid\r
-+   addresses (especially on SGI's Indigo2 R10k (IP28)).  */\r
-+const char *mips_ip28_cache_barrier;\r
-+\r
- /* If TRUE, we split addresses into their high and low parts in the RTL.  */\r
- int mips_split_addresses;\r
- \r
-@@ -9676,3 +9681,7 @@\r
- #endif /* TARGET_IRIX */\r
- \r
- #include "gt-mips.h"\r
-+/*\r
-+ * mips.c     Wed Jul  7 21:21:10 2004\r
-+ * mips.c     Fri Sep 17 23:25:53 2004        ip28\r
-+ */\r
---- gcc-3.4.2/gcc/final.c      Sun Jan 18 23:39:57 2004\r
-+++ gcc-3.4.2/gcc/final.c      Thu Apr  7 00:00:05 2005\r
-@@ -146,6 +146,13 @@\r
- \r
- static rtx last_ignored_compare = 0;\r
- \r
-+/* Flag indicating this insn is the start of a new basic block.  */\r
-+\r
-+#define NEW_BLOCK_LABEL  1\r
-+#define NEW_BLOCK_BRANCH 2\r
-+\r
-+static int new_block = NEW_BLOCK_LABEL;\r
-+\r
- /* Assign a unique number to each insn that is output.\r
-    This can be used to generate unique local labels.  */\r
- \r
-@@ -235,6 +242,7 @@\r
- #ifdef HAVE_ATTR_length\r
- static int align_fuzz (rtx, rtx, int, unsigned);\r
- #endif\r
-+static int output_store_cache_barrier (FILE *, rtx);\r
- \f\r
- /* Initialize data in final at the beginning of a compilation.  */\r
- \r
-@@ -1505,6 +1513,7 @@\r
-   int seen = 0;\r
- \r
-   last_ignored_compare = 0;\r
-+  new_block = NEW_BLOCK_LABEL;\r
- \r
- #ifdef SDB_DEBUGGING_INFO\r
-   /* When producing SDB debugging info, delete troublesome line number\r
-@@ -1571,6 +1580,7 @@\r
- \r
-       insn = final_scan_insn (insn, file, optimize, prescan, 0, &seen);\r
-     }\r
-+  new_block = 0;\r
- }\r
- \f\r
- const char *\r
-@@ -1851,6 +1861,7 @@\r
- #endif\r
-       if (prescan > 0)\r
-       break;\r
-+      new_block = NEW_BLOCK_LABEL;\r
- \r
-       if (LABEL_NAME (insn))\r
-       (*debug_hooks->label) (insn);\r
-@@ -2009,6 +2020,26 @@\r
- \r
-           break;\r
-         }\r
-+\r
-+#ifdef TARGET_IP28\r
-+      if (new_block)\r
-+        {\r
-+          /* .reorder: not really in the branch-delay-slot. */\r
-+          if (! set_noreorder)\r
-+            new_block = NEW_BLOCK_LABEL;\r
-+\r
-+          if (new_block == NEW_BLOCK_BRANCH)\r
-+            /* Not yet, only *after* the branch-delay-slot ! */\r
-+            new_block = NEW_BLOCK_LABEL;\r
-+          else\r
-+            {\r
-+              if (TARGET_IP28)\r
-+                output_store_cache_barrier (file, insn);\r
-+              new_block = 0;\r
-+            }\r
-+        }\r
-+#endif\r
-+\r
-       /* Output this line note if it is the first or the last line\r
-          note in a row.  */\r
-       if (notice_source_line (insn))\r
-@@ -2132,8 +2163,29 @@\r
-              clobbered by the function.  */\r
-           if (GET_CODE (XVECEXP (body, 0, 0)) == CALL_INSN)\r
-             {\r
-+#ifdef TARGET_IP28\r
-+              if (TARGET_IP28)\r
-+                new_block = NEW_BLOCK_LABEL;\r
-+#endif\r
-               CC_STATUS_INIT;\r
-             }\r
-+#ifdef TARGET_IP28\r
-+          /* Following a conditional branch sequence, we have a new basic\r
-+             block.  */\r
-+          if (TARGET_IP28)\r
-+            {\r
-+              rtx insn = XVECEXP (body, 0, 0);\r
-+              rtx body = PATTERN (insn);\r
-+\r
-+              if ((GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == SET\r
-+                   && GET_CODE (SET_SRC (body)) != LABEL_REF)\r
-+                  || (GET_CODE (insn) == JUMP_INSN\r
-+                      && GET_CODE (body) == PARALLEL\r
-+                      && GET_CODE (XVECEXP (body, 0, 0)) == SET\r
-+                      && GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) != LABEL_REF))\r
-+                new_block = NEW_BLOCK_LABEL;\r
-+            }\r
-+#endif\r
-           break;\r
-         }\r
- \r
-@@ -2188,6 +2240,20 @@\r
-         }\r
- #endif\r
- \r
-+#ifdef TARGET_IP28\r
-+      /* Following a conditional branch, we have a new basic block.\r
-+         But if we are inside a sequence, the new block starts after the\r
-+         last insn of the sequence.  */\r
-+      if (TARGET_IP28 && final_sequence == 0\r
-+          && (GET_CODE (insn) == CALL_INSN\r
-+              || (GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == SET\r
-+                  && GET_CODE (SET_SRC (body)) != LABEL_REF)\r
-+              || (GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == PARALLEL\r
-+                  && GET_CODE (XVECEXP (body, 0, 0)) == SET\r
-+                  && GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) != LABEL_REF)))\r
-+            new_block = NEW_BLOCK_BRANCH;\r
-+#endif\r
-+\r
- #ifndef STACK_REGS\r
-       /* Don't bother outputting obvious no-ops, even without -O.\r
-          This optimization is fast and doesn't interfere with debugging.\r
-@@ -2402,6 +2468,7 @@\r
- \r
-           if (prev_nonnote_insn (insn) != last_ignored_compare)\r
-             abort ();\r
-+          new_block = 0;\r
- \r
-           /* We have already processed the notes between the setter and\r
-              the user.  Make sure we don't process them again, this is\r
-@@ -2435,6 +2502,7 @@\r
-           abort ();\r
- #endif\r
- \r
-+          new_block = 0;\r
-           return new;\r
-         }\r
- \r
-@@ -3866,3 +3934,254 @@\r
-       symbol_queue_size = 0;\r
-     }\r
- }\r
-+\r
-+\r
-+#ifdef TARGET_IP28\r
-+\r
-+/* Check, whether an instruction is a possibly harmful store instruction,\r
-+   i.e. a store which might cause damage, if speculatively executed. */\r
-+\r
-+static rtx\r
-+find_mem_expr (rtx xexp)\r
-+{\r
-+  if (xexp)\r
-+    {\r
-+      const char *fmt;\r
-+      int i, j, lng;\r
-+      rtx x;\r
-+      RTX_CODE code = GET_CODE (xexp);\r
-+\r
-+      if (MEM == code)\r
-+        return xexp;\r
-+\r
-+      fmt = GET_RTX_FORMAT (code);\r
-+      lng = GET_RTX_LENGTH (code);\r
-+\r
-+      for (i = 0; i < lng; ++i)\r
-+        switch (fmt[i])\r
-+          {\r
-+          case 'e':\r
-+            x = find_mem_expr (XEXP (xexp, i));\r
-+            if (x)\r
-+              return x;\r
-+            break;\r
-+          case 'E':\r
-+            if (XVEC (xexp, i))\r
-+              for (j = 0; j < XVECLEN (xexp, i); ++j)\r
-+                {\r
-+                  x = find_mem_expr (XVECEXP (xexp, i, j));\r
-+                  if (x)\r
-+                    return x;\r
-+                }\r
-+          }\r
-+    }\r
-+  return 0;\r
-+}\r
-+\r
-+static int\r
-+check_mem_expr (rtx memx)\r
-+{\r
-+  /* Check the expression `memx' (with type GET_CODE(memx) == MEM)\r
-+     for the most common stackpointer-addressing modes.\r
-+     It's not worthwile to avoid a cache barrier also on the\r
-+     remaining unfrequently used modes.  */\r
-+  rtx x = XEXP (memx, 0);\r
-+  switch (GET_CODE (x))\r
-+    {\r
-+    case REG:\r
-+      if (REGNO (x) == STACK_POINTER_REGNUM)\r
-+        return 0;\r
-+    default:\r
-+      break;\r
-+    case PLUS: case MINUS: /* always `SP + const' ? */\r
-+      if (GET_CODE (XEXP (x, 1)) == REG\r
-+          && REGNO (XEXP (x, 1)) == STACK_POINTER_REGNUM)\r
-+        return 0;\r
-+    case NEG: case SIGN_EXTEND: case ZERO_EXTEND:\r
-+      if (GET_CODE (XEXP (x, 0)) == REG\r
-+          && REGNO (XEXP (x, 0)) == STACK_POINTER_REGNUM)\r
-+        return 0;\r
-+    }\r
-+\r
-+  /* Stores/Loads to/from constant addresses can be considered\r
-+     harmless, since:\r
-+     1)  the address is always valid, even when taken speculatively.\r
-+     2a) the location is (hopefully) never used as a dma-target, thus\r
-+         there is no danger of cache-inconsistency.\r
-+     2b) uncached loads/stores are guaranteed to be non-speculative. */\r
-+  if ( CONSTANT_P(x) )\r
-+    return 0;\r
-+\r
-+  return 1;\r
-+}\r
-+\r
-+/* inline */ static int\r
-+check_pattern_for_store (rtx body)\r
-+{\r
-+  /* Check for (set (mem:M (non_stackpointer_address) ...)).  Here we\r
-+     assume, that addressing with the stackpointer accesses neither\r
-+     uncached-aliased nor invalid memory.  (May be, this applies to the\r
-+     global pointer and frame pointer also, but its saver not to assume\r
-+     it. And probably it's not worthwile to regard these registers)\r
-+\r
-+     Speculative loads from invalid addresses also cause bus errors...\r
-+     So check for (set (reg:M ...) (mem:M (non_stackpointer_address)))\r
-+     too. */\r
-+\r
-+  if (body && GET_CODE (body) == SET)\r
-+    {\r
-+      rtx x = find_mem_expr (body);\r
-+\r
-+      if (x && check_mem_expr (x))\r
-+        return 1;\r
-+    }\r
-+  return 0;\r
-+}\r
-+\r
-+static int\r
-+check_insn_for_store (int state, rtx insn)\r
-+{\r
-+  /* Check for (ins (set (mem:M (dangerous_address)) ...)) or end of the\r
-+     current basic block.\r
-+     Criteria to recognize end-of/next basic-block are reduplicated here\r
-+     from final_scan_insn. */\r
-+\r
-+  rtx body;\r
-+  int code;\r
-+\r
-+  if (INSN_DELETED_P (insn))\r
-+    return 0;\r
-+\r
-+  switch (code = GET_CODE (insn))\r
-+    {\r
-+    case CODE_LABEL:\r
-+      return -1;\r
-+    case CALL_INSN:\r
-+    case JUMP_INSN:\r
-+    case INSN:\r
-+      body = PATTERN (insn);\r
-+      if (GET_CODE (body) == SEQUENCE)\r
-+        {\r
-+          /* A delayed-branch sequence */\r
-+          rtx ins0 = XVECEXP (body, 0, 0);\r
-+          rtx pat0 = PATTERN (ins0);\r
-+          int i;\r
-+          for (i = 0; i < XVECLEN (body, 0); i++)\r
-+            {\r
-+              rtx insq = XVECEXP (body, 0, i);\r
-+              if (! INSN_DELETED_P (insq))\r
-+                {\r
-+                  int j = check_insn_for_store (state|1, insq);\r
-+                  if (j)\r
-+                    return j;\r
-+                }\r
-+            }\r
-+          /* Following a conditional branch sequence, we have a new\r
-+             basic block.  */\r
-+          if (GET_CODE (ins0) == JUMP_INSN)\r
-+            if ((GET_CODE (pat0) == SET\r
-+                 && GET_CODE (SET_SRC (pat0)) != LABEL_REF)\r
-+                || (GET_CODE (pat0) == PARALLEL\r
-+                    && GET_CODE (XVECEXP (pat0, 0, 0)) == SET\r
-+                    && GET_CODE (SET_SRC (XVECEXP (pat0, 0, 0))) != LABEL_REF))\r
-+              return -1;\r
-+          /* Handle a call sequence like a conditional branch sequence */\r
-+          if (GET_CODE (ins0) == CALL_INSN)\r
-+            return -1;\r
-+          break;\r
-+        }\r
-+      if (GET_CODE (body) == PARALLEL)\r
-+        {\r
-+          int i;\r
-+          for (i = 0; i < XVECLEN (body, 0); i++)\r
-+            if (check_pattern_for_store (XVECEXP (body, 0, i)))\r
-+              return 1;\r
-+        }\r
-+      /* Now, only a `simple' INSN or JUMP_INSN remains to be checked. */\r
-+      if (code == INSN)\r
-+        {\r
-+          /* Since we don't know, what's inside, we must take inline\r
-+             assembly to be dangerous */\r
-+          if (GET_CODE (body) == ASM_INPUT)\r
-+            return 1;\r
-+\r
-+          if (check_pattern_for_store (body))\r
-+            return 1;\r
-+        }\r
-+      /* Handle a CALL_INSN instruction like a conditional branch */\r
-+      if (code == JUMP_INSN || code == CALL_INSN)\r
-+        {\r
-+          /* Following a conditional branch, we have a new basic block. */\r
-+          int ckds = 0;\r
-+          if (code == CALL_INSN)\r
-+            ckds = 1;\r
-+          else\r
-+            {\r
-+              code = GET_CODE (body);\r
-+              if ((code == SET\r
-+                   && GET_CODE (SET_SRC (body)) != LABEL_REF)\r
-+                  || (code == PARALLEL\r
-+                      && GET_CODE (XVECEXP (body, 0, 0)) == SET\r
-+                      && GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) != LABEL_REF))\r
-+                ckds = 1;\r
-+            }\r
-+          if (ckds)\r
-+            {\r
-+              /* But check insn(s) in delay-slot first.  If we could know in\r
-+                 advance that this jump is in `.reorder' mode, where gas will\r
-+                 insert a `nop' into the delay-slot, we could skip this test.\r
-+                 Since we don't know, always assume `.noreorder', sometimes\r
-+                 emitting a cache-barrier, that isn't needed.  */\r
-+              /* But if we are here recursively, already checking a (pseudo-)\r
-+                 delay-slot, we are done.  */\r
-+              if ( !(state & 2) )\r
-+                for (insn = NEXT_INSN (insn); insn; insn = NEXT_INSN (insn))\r
-+                  switch (GET_CODE (insn))\r
-+                    {\r
-+                    case INSN:\r
-+                      if (check_insn_for_store (state|1|2, insn) > 0)\r
-+                        return 1;\r
-+                    case CODE_LABEL:\r
-+                    case CALL_INSN:\r
-+                    case JUMP_INSN:\r
-+                      return -1;\r
-+                    default:\r
-+                      /* skip NOTE,... */;\r
-+                    }\r
-+              return -1;\r
-+            }\r
-+        }\r
-+      /*break*/\r
-+    }\r
-+  return 0;\r
-+}\r
-+\r
-+/* Scan a basic block, starting with `insn', for a possibly harmful store\r
-+   instruction.  If found, output a cache barrier at the start of this\r
-+   block.  */\r
-+\r
-+static int\r
-+output_store_cache_barrier (FILE *file, rtx insn)\r
-+{\r
-+  for (; insn; insn = NEXT_INSN (insn))\r
-+    {\r
-+      int found = check_insn_for_store (0, insn);\r
-+      if (found < 0)\r
-+        break;\r
-+      if (found > 0)\r
-+        {\r
-+          /* found critical store instruction */\r
-+          ASM_OUTPUT_R10K_CACHE_BARRIER(file);\r
-+          return 1;\r
-+        }\r
-+    }\r
-+  fprintf(file, "\t%s Cache Barrier omitted.\n", ASM_COMMENT_START);\r
-+  return 0;\r
-+}\r
-+\r
-+#endif /* TARGET_IP28 */\r
-+\r
-+/*\r
-+ * final.c    Sun Jan 18 23:39:57 2004\r
-+ * final.c    Sat Sep 18 00:23:34 2004        ip28\r
-+ */\r
+--- gcc-3.4.2/gcc/config/mips/mips.h   Thu Jul 15 02:42:47 2004
++++ gcc-3.4.2/gcc/config/mips/mips.h   Sat Sep 18 00:41:48 2004
+@@ -122,6 +122,7 @@
+ extern const char *mips_isa_string;   /* for -mips{1,2,3,4} */
+ extern const char *mips_abi_string;   /* for -mabi={32,n32,64} */
+ extern const char *mips_cache_flush_func;/* for -mflush-func= and -mno-flush-func */
++extern const char *mips_ip28_cache_barrier;/* for -mip28-cache-barrier */
+ extern int mips_string_length;                /* length of strings for mips16 */
+ extern const struct mips_cpu_info mips_cpu_info_table[];
+ extern const struct mips_cpu_info *mips_arch_info;
+@@ -333,6 +334,7 @@
+ #define TARGET_MIPS9000             (mips_arch == PROCESSOR_R9000)
+ #define TARGET_SB1                  (mips_arch == PROCESSOR_SB1)
+ #define TARGET_SR71K                (mips_arch == PROCESSOR_SR71000)
++#define TARGET_IP28                 (mips_ip28_cache_barrier != 0)
+ 
+ /* Scheduling target defines.  */
+ #define TUNE_MIPS3000               (mips_tune == PROCESSOR_R3000)
+@@ -752,6 +754,8 @@
+       N_("Don't call any cache flush functions"), 0},                 \
+   { "flush-func=", &mips_cache_flush_func,                            \
+       N_("Specify cache flush function"), 0},                         \
++  { "ip28-cache-barrier", &mips_ip28_cache_barrier,                   \
++      N_("Generate special cache barriers for SGI Indigo2 R10k"), 0}, \
+ }
+ 
+ /* This is meant to be redefined in the host dependent files.  */
+@@ -3448,3 +3452,11 @@
+       " TEXT_SECTION_ASM_OP);
+ #endif
+ #endif
++\f
++#define ASM_OUTPUT_R10K_CACHE_BARRIER(STREAM)         \
++  fprintf (STREAM, "\tcache 0x14,0($sp)\t%s Cache Barrier\n", ASM_COMMENT_START)
++
++/*
++ * mips.h     Thu Jul 15 02:42:47 2004
++ * mips.h     Fri Sep 17 23:18:19 2004        ip28
++ */
+--- gcc-3.4.2/gcc/config/mips/mips.c   Wed Jul  7 21:21:10 2004
++++ gcc-3.4.2/gcc/config/mips/mips.c   Fri Sep 17 23:33:44 2004
+@@ -502,6 +502,11 @@
+ 
+ const char *mips_cache_flush_func = CACHE_FLUSH_FUNC;
+ 
++/* Nonzero means generate special cache barriers to inhibit speculative
++   stores which might endanger cache coherency or reference invalid
++   addresses (especially on SGI's Indigo2 R10k (IP28)).  */
++const char *mips_ip28_cache_barrier;
++
+ /* If TRUE, we split addresses into their high and low parts in the RTL.  */
+ int mips_split_addresses;
+ 
+@@ -9676,3 +9681,7 @@
+ #endif /* TARGET_IRIX */
+ 
+ #include "gt-mips.h"
++/*
++ * mips.c     Wed Jul  7 21:21:10 2004
++ * mips.c     Fri Sep 17 23:25:53 2004        ip28
++ */
+--- gcc-3.4.2/gcc/final.c      Sun Jan 18 23:39:57 2004
++++ gcc-3.4.2/gcc/final.c      Thu Apr  7 00:00:05 2005
+@@ -146,6 +146,13 @@
+ 
+ static rtx last_ignored_compare = 0;
+ 
++/* Flag indicating this insn is the start of a new basic block.  */
++
++#define NEW_BLOCK_LABEL  1
++#define NEW_BLOCK_BRANCH 2
++
++static int new_block = NEW_BLOCK_LABEL;
++
+ /* Assign a unique number to each insn that is output.
+    This can be used to generate unique local labels.  */
+ 
+@@ -235,6 +242,7 @@
+ #ifdef HAVE_ATTR_length
+ static int align_fuzz (rtx, rtx, int, unsigned);
+ #endif
++static int output_store_cache_barrier (FILE *, rtx);
+ \f
+ /* Initialize data in final at the beginning of a compilation.  */
+ 
+@@ -1505,6 +1513,7 @@
+   int seen = 0;
+ 
+   last_ignored_compare = 0;
++  new_block = NEW_BLOCK_LABEL;
+ 
+ #ifdef SDB_DEBUGGING_INFO
+   /* When producing SDB debugging info, delete troublesome line number
+@@ -1571,6 +1580,7 @@
+ 
+       insn = final_scan_insn (insn, file, optimize, prescan, 0, &seen);
+     }
++  new_block = 0;
+ }
+ \f
+ const char *
+@@ -1851,6 +1861,7 @@
+ #endif
+       if (prescan > 0)
+       break;
++      new_block = NEW_BLOCK_LABEL;
+ 
+       if (LABEL_NAME (insn))
+       (*debug_hooks->label) (insn);
+@@ -2009,6 +2020,26 @@
+ 
+           break;
+         }
++
++#ifdef TARGET_IP28
++      if (new_block)
++        {
++          /* .reorder: not really in the branch-delay-slot. */
++          if (! set_noreorder)
++            new_block = NEW_BLOCK_LABEL;
++
++          if (new_block == NEW_BLOCK_BRANCH)
++            /* Not yet, only *after* the branch-delay-slot ! */
++            new_block = NEW_BLOCK_LABEL;
++          else
++            {
++              if (TARGET_IP28)
++                output_store_cache_barrier (file, insn);
++              new_block = 0;
++            }
++        }
++#endif
++
+       /* Output this line note if it is the first or the last line
+          note in a row.  */
+       if (notice_source_line (insn))
+@@ -2132,8 +2163,29 @@
+              clobbered by the function.  */
+           if (GET_CODE (XVECEXP (body, 0, 0)) == CALL_INSN)
+             {
++#ifdef TARGET_IP28
++              if (TARGET_IP28)
++                new_block = NEW_BLOCK_LABEL;
++#endif
+               CC_STATUS_INIT;
+             }
++#ifdef TARGET_IP28
++          /* Following a conditional branch sequence, we have a new basic
++             block.  */
++          if (TARGET_IP28)
++            {
++              rtx insn = XVECEXP (body, 0, 0);
++              rtx body = PATTERN (insn);
++
++              if ((GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == SET
++                   && GET_CODE (SET_SRC (body)) != LABEL_REF)
++                  || (GET_CODE (insn) == JUMP_INSN
++                      && GET_CODE (body) == PARALLEL
++                      && GET_CODE (XVECEXP (body, 0, 0)) == SET
++                      && GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) != LABEL_REF))
++                new_block = NEW_BLOCK_LABEL;
++            }
++#endif
+           break;
+         }
+ 
+@@ -2188,6 +2240,20 @@
+         }
+ #endif
+ 
++#ifdef TARGET_IP28
++      /* Following a conditional branch, we have a new basic block.
++         But if we are inside a sequence, the new block starts after the
++         last insn of the sequence.  */
++      if (TARGET_IP28 && final_sequence == 0
++          && (GET_CODE (insn) == CALL_INSN
++              || (GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == SET
++                  && GET_CODE (SET_SRC (body)) != LABEL_REF)
++              || (GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == PARALLEL
++                  && GET_CODE (XVECEXP (body, 0, 0)) == SET
++                  && GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) != LABEL_REF)))
++            new_block = NEW_BLOCK_BRANCH;
++#endif
++
+ #ifndef STACK_REGS
+       /* Don't bother outputting obvious no-ops, even without -O.
+          This optimization is fast and doesn't interfere with debugging.
+@@ -2402,6 +2468,7 @@
+ 
+           if (prev_nonnote_insn (insn) != last_ignored_compare)
+             abort ();
++          new_block = 0;
+ 
+           /* We have already processed the notes between the setter and
+              the user.  Make sure we don't process them again, this is
+@@ -2435,6 +2502,7 @@
+           abort ();
+ #endif
+ 
++          new_block = 0;
+           return new;
+         }
+ 
+@@ -3866,3 +3934,254 @@
+       symbol_queue_size = 0;
+     }
+ }
++
++
++#ifdef TARGET_IP28
++
++/* Check, whether an instruction is a possibly harmful store instruction,
++   i.e. a store which might cause damage, if speculatively executed. */
++
++static rtx
++find_mem_expr (rtx xexp)
++{
++  if (xexp)
++    {
++      const char *fmt;
++      int i, j, lng;
++      rtx x;
++      RTX_CODE code = GET_CODE (xexp);
++
++      if (MEM == code)
++        return xexp;
++
++      fmt = GET_RTX_FORMAT (code);
++      lng = GET_RTX_LENGTH (code);
++
++      for (i = 0; i < lng; ++i)
++        switch (fmt[i])
++          {
++          case 'e':
++            x = find_mem_expr (XEXP (xexp, i));
++            if (x)
++              return x;
++            break;
++          case 'E':
++            if (XVEC (xexp, i))
++              for (j = 0; j < XVECLEN (xexp, i); ++j)
++                {
++                  x = find_mem_expr (XVECEXP (xexp, i, j));
++                  if (x)
++                    return x;
++                }
++          }
++    }
++  return 0;
++}
++
++static int
++check_mem_expr (rtx memx)
++{
++  /* Check the expression `memx' (with type GET_CODE(memx) == MEM)
++     for the most common stackpointer-addressing modes.
++     It's not worthwile to avoid a cache barrier also on the
++     remaining unfrequently used modes.  */
++  rtx x = XEXP (memx, 0);
++  switch (GET_CODE (x))
++    {
++    case REG:
++      if (REGNO (x) == STACK_POINTER_REGNUM)
++        return 0;
++    default:
++      break;
++    case PLUS: case MINUS: /* always `SP + const' ? */
++      if (GET_CODE (XEXP (x, 1)) == REG
++          && REGNO (XEXP (x, 1)) == STACK_POINTER_REGNUM)
++        return 0;
++    case NEG: case SIGN_EXTEND: case ZERO_EXTEND:
++      if (GET_CODE (XEXP (x, 0)) == REG
++          && REGNO (XEXP (x, 0)) == STACK_POINTER_REGNUM)
++        return 0;
++    }
++
++  /* Stores/Loads to/from constant addresses can be considered
++     harmless, since:
++     1)  the address is always valid, even when taken speculatively.
++     2a) the location is (hopefully) never used as a dma-target, thus
++         there is no danger of cache-inconsistency.
++     2b) uncached loads/stores are guaranteed to be non-speculative. */
++  if ( CONSTANT_P(x) )
++    return 0;
++
++  return 1;
++}
++
++/* inline */ static int
++check_pattern_for_store (rtx body)
++{
++  /* Check for (set (mem:M (non_stackpointer_address) ...)).  Here we
++     assume, that addressing with the stackpointer accesses neither
++     uncached-aliased nor invalid memory.  (May be, this applies to the
++     global pointer and frame pointer also, but its saver not to assume
++     it. And probably it's not worthwile to regard these registers)
++
++     Speculative loads from invalid addresses also cause bus errors...
++     So check for (set (reg:M ...) (mem:M (non_stackpointer_address)))
++     too. */
++
++  if (body && GET_CODE (body) == SET)
++    {
++      rtx x = find_mem_expr (body);
++
++      if (x && check_mem_expr (x))
++        return 1;
++    }
++  return 0;
++}
++
++static int
++check_insn_for_store (int state, rtx insn)
++{
++  /* Check for (ins (set (mem:M (dangerous_address)) ...)) or end of the
++     current basic block.
++     Criteria to recognize end-of/next basic-block are reduplicated here
++     from final_scan_insn. */
++
++  rtx body;
++  int code;
++
++  if (INSN_DELETED_P (insn))
++    return 0;
++
++  switch (code = GET_CODE (insn))
++    {
++    case CODE_LABEL:
++      return -1;
++    case CALL_INSN:
++    case JUMP_INSN:
++    case INSN:
++      body = PATTERN (insn);
++      if (GET_CODE (body) == SEQUENCE)
++        {
++          /* A delayed-branch sequence */
++          rtx ins0 = XVECEXP (body, 0, 0);
++          rtx pat0 = PATTERN (ins0);
++          int i;
++          for (i = 0; i < XVECLEN (body, 0); i++)
++            {
++              rtx insq = XVECEXP (body, 0, i);
++              if (! INSN_DELETED_P (insq))
++                {
++                  int j = check_insn_for_store (state|1, insq);
++                  if (j)
++                    return j;
++                }
++            }
++          /* Following a conditional branch sequence, we have a new
++             basic block.  */
++          if (GET_CODE (ins0) == JUMP_INSN)
++            if ((GET_CODE (pat0) == SET
++                 && GET_CODE (SET_SRC (pat0)) != LABEL_REF)
++                || (GET_CODE (pat0) == PARALLEL
++                    && GET_CODE (XVECEXP (pat0, 0, 0)) == SET
++                    && GET_CODE (SET_SRC (XVECEXP (pat0, 0, 0))) != LABEL_REF))
++              return -1;
++          /* Handle a call sequence like a conditional branch sequence */
++          if (GET_CODE (ins0) == CALL_INSN)
++            return -1;
++          break;
++        }
++      if (GET_CODE (body) == PARALLEL)
++        {
++          int i;
++          for (i = 0; i < XVECLEN (body, 0); i++)
++            if (check_pattern_for_store (XVECEXP (body, 0, i)))
++              return 1;
++        }
++      /* Now, only a `simple' INSN or JUMP_INSN remains to be checked. */
++      if (code == INSN)
++        {
++          /* Since we don't know, what's inside, we must take inline
++             assembly to be dangerous */
++          if (GET_CODE (body) == ASM_INPUT)
++            return 1;
++
++          if (check_pattern_for_store (body))
++            return 1;
++        }
++      /* Handle a CALL_INSN instruction like a conditional branch */
++      if (code == JUMP_INSN || code == CALL_INSN)
++        {
++          /* Following a conditional branch, we have a new basic block. */
++          int ckds = 0;
++          if (code == CALL_INSN)
++            ckds = 1;
++          else
++            {
++              code = GET_CODE (body);
++              if ((code == SET
++                   && GET_CODE (SET_SRC (body)) != LABEL_REF)
++                  || (code == PARALLEL
++                      && GET_CODE (XVECEXP (body, 0, 0)) == SET
++                      && GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) != LABEL_REF))
++                ckds = 1;
++            }
++          if (ckds)
++            {
++              /* But check insn(s) in delay-slot first.  If we could know in
++                 advance that this jump is in `.reorder' mode, where gas will
++                 insert a `nop' into the delay-slot, we could skip this test.
++                 Since we don't know, always assume `.noreorder', sometimes
++                 emitting a cache-barrier, that isn't needed.  */
++              /* But if we are here recursively, already checking a (pseudo-)
++                 delay-slot, we are done.  */
++              if ( !(state & 2) )
++                for (insn = NEXT_INSN (insn); insn; insn = NEXT_INSN (insn))
++                  switch (GET_CODE (insn))
++                    {
++                    case INSN:
++                      if (check_insn_for_store (state|1|2, insn) > 0)
++                        return 1;
++                    case CODE_LABEL:
++                    case CALL_INSN:
++                    case JUMP_INSN:
++                      return -1;
++                    default:
++                      /* skip NOTE,... */;
++                    }
++              return -1;
++            }
++        }
++      /*break*/
++    }
++  return 0;
++}
++
++/* Scan a basic block, starting with `insn', for a possibly harmful store
++   instruction.  If found, output a cache barrier at the start of this
++   block.  */
++
++static int
++output_store_cache_barrier (FILE *file, rtx insn)
++{
++  for (; insn; insn = NEXT_INSN (insn))
++    {
++      int found = check_insn_for_store (0, insn);
++      if (found < 0)
++        break;
++      if (found > 0)
++        {
++          /* found critical store instruction */
++          ASM_OUTPUT_R10K_CACHE_BARRIER(file);
++          return 1;
++        }
++    }
++  fprintf(file, "\t%s Cache Barrier omitted.\n", ASM_COMMENT_START);
++  return 0;
++}
++
++#endif /* TARGET_IP28 */
++
++/*
++ * final.c    Sun Jan 18 23:39:57 2004
++ * final.c    Sat Sep 18 00:23:34 2004        ip28
++ */