Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 gcl (2.6.7+dfsga-4) unstable; urgency=high
 .
   * sgc-on fix with latest gcc
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- gcl-2.6.7+dfsga.orig/o/sgbc.c
+++ gcl-2.6.7+dfsga/o/sgbc.c
@@ -1158,14 +1158,14 @@ memprotect_test(void) {
     return -1;
   }
   { /* mips kernel bug test -- SIGBUS with no faddr when floating point is emulated. */
-    float *f1=(void *)memprotect_test_address,*f2=(void *)b2;
+    float *f1=(void *)memprotect_test_address,*f2=(void *)b2,*f1e=f1+p/sizeof(*f1);
   
     if (mprotect(memprotect_test_address,p,PROT_READ_EXEC)) {
       memprotect_result=memprotect_cannot_protect;
       return -1;
     }
     memprotect_result=memprotect_bad_return;
-    *f1=*f2;
+    for (;f1<f1e;) *f1++=*f2;
     if (memprotect_result==memprotect_bad_return)
       memprotect_result=memprotect_no_signal;
     if (memprotect_result!=memprotect_none) {
