385abae
Description: <short summary of the patch>
385abae
 TODO: Put a short summary on the line above and replace this paragraph
385abae
 with a longer explanation of this change. Complete the meta-information
385abae
 with other relevant fields (see below for details). To make it easier, the
385abae
 information below has been extracted from the changelog. Adjust it or drop
385abae
 it.
385abae
 .
385abae
 gcl (2.6.12-75) unstable; urgency=medium
385abae
 .
385abae
   * Version_2_6_13pre64
385abae
Author: Camm Maguire <camm@debian.org>
385abae
385abae
---
385abae
The information above should follow the Patch Tagging Guidelines, please
385abae
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
385abae
are templates for supplementary fields that you might want to add:
385abae
385abae
Origin: <vendor|upstream|other>, <url of original patch>
385abae
Bug: <url in upstream bugtracker>
385abae
Bug-Debian: https://bugs.debian.org/<bugnumber>
385abae
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
385abae
Forwarded: <no|not-needed|url proving that it has been forwarded>
385abae
Reviewed-By: <name and email of someone who approved the patch>
385abae
Last-Update: 2018-03-22
385abae
385abae
--- gcl-2.6.12.orig/cmpnew/gcl_cmpif.lsp
385abae
+++ gcl-2.6.12/cmpnew/gcl_cmpif.lsp
385abae
@@ -428,9 +428,8 @@
385abae
 	(wt-label label))))
385abae
 
385abae
   (if (eq default 't)
385abae
-      (progn (wt-nl "FEerror(\"The ECASE key value ~s is illegal.\",1,V" cvar ");")
385abae
-	     (unwind-exit nil 'jump))
385abae
-      (c2expr default))
385abae
+      (wt-nl "FEerror(\"The ECASE key value ~s is illegal.\",1,V" cvar ");")
385abae
+    (c2expr default))
385abae
 
385abae
   (wt "}")
385abae
   (close-inline-blocks))
385abae
--- gcl-2.6.12.orig/cmpnew/gcl_cmpmulti.lsp
385abae
+++ gcl-2.6.12/cmpnew/gcl_cmpmulti.lsp
385abae
@@ -221,56 +221,36 @@
385abae
 
385abae
 
385abae
 (defun c2multiple-value-bind (vars init-form body
385abae
-                   &aux (block-p nil) (labels nil)
385abae
-                        (*unwind-exit* *unwind-exit*)
385abae
-                        (*vs* *vs*) (*clink* *clink*) (*ccb-vs* *ccb-vs*)
385abae
-			top-data)
385abae
-       (declare (object block-p))
385abae
-    (multiple-value-check vars init-form)
385abae
+				   &aux (block-p nil)
385abae
+				   (*unwind-exit* *unwind-exit*)
385abae
+				   (*vs* *vs*) (*clink* *clink*) (*ccb-vs* *ccb-vs*)
385abae
+				   top-data)
385abae
 
385abae
-  (dolist** (var vars)
385abae
+  (multiple-value-check vars init-form)
385abae
+
385abae
+  (dolist (var vars)
385abae
     (let ((kind (c2var-kind var)))
385abae
-         (declare (object kind))
385abae
       (if kind
385abae
           (let ((cvar (next-cvar)))
385abae
             (setf (var-kind var) kind)
385abae
             (setf (var-loc var) cvar)
385abae
             (wt-nl)
385abae
             (unless block-p (wt "{") (setq block-p t))
385abae
-	    (wt-var-decl var)
385abae
-	    )
385abae
-          (setf (var-ref var) (vs-push)))))
385abae
+	    (wt-var-decl var))
385abae
+	(setf (var-ref var) (vs-push)))))
385abae
 
385abae
   (let ((*value-to-go* 'top) *top-data*)
385abae
     (c2expr* init-form) (setq top-data *top-data*))
385abae
+
385abae
   (and *record-call-info* (record-call-info nil (car top-data)))
385abae
-  (let ((*clink* *clink*)
385abae
-        (*unwind-exit* *unwind-exit*)
385abae
-        (*ccb-vs* *ccb-vs*))
385abae
-    (do ((vs vars (cdr vs)))
385abae
-        ((endp vs))
385abae
-        (declare (object vs))
385abae
-      (push (next-label) labels)
385abae
-      (wt-nl "if(vs_base>=vs_top){")
385abae
-      (reset-top)
385abae
-      (wt-go (car labels)) (wt "}")
385abae
+
385abae
+  (wt-nl "if(vs_base>vs_top) vs_top=vs_base;*vs_top=Cnil;")
385abae
+  (do ((vs vars (cdr vs)))
385abae
+      ((endp vs))
385abae
       (c2bind-loc (car vs) '(vs-base 0))
385abae
-      (unless (endp (cdr vs)) (wt-nl "vs_base++;"))))
385abae
+      (unless (endp (cdr vs)) (wt-nl "if (vs_base
385abae
 
385abae
   (wt-nl) (reset-top)
385abae
 
385abae
-  (let ((label (next-label)))
385abae
-    (wt-nl) (wt-go label)
385abae
-
385abae
-    (setq labels (nreverse labels))
385abae
-
385abae
-    (dolist** (v vars)
385abae
-      (wt-label (car labels))
385abae
-      (pop labels)
385abae
-      (c2bind-loc v nil))
385abae
-
385abae
-    (wt-label label))
385abae
-
385abae
   (c2expr body)
385abae
-  (when block-p (wt "}"))
385abae
-  )
385abae
+  (when block-p (wt "}")))
385abae
--- gcl-2.6.12.orig/cmpnew/gcl_cmptag.lsp
385abae
+++ gcl-2.6.12/cmpnew/gcl_cmptag.lsp
385abae
@@ -178,7 +178,7 @@
385abae
                        (*value-to-go* 'trash))
385abae
                   (c2expr (car l))
385abae
                   (wt-label *exit*))
385abae
-                (unless (eq (caar l) 'go) (unwind-exit nil)))))
385abae
+                (unless (member (caar l) '(go return-from)) (unwind-exit nil)))))
385abae
       (declare (object l written))
385abae
     (cond (written (setq written nil))
385abae
           ((typep (car l) 'tag)
385abae
--- gcl-2.6.12.orig/configure
385abae
+++ gcl-2.6.12/configure
385abae
@@ -4159,7 +4159,7 @@ case $use in
385abae
 	case $use in
385abae
 	    alpha*)
385abae
 		assert_arg_to_cflags -mieee
385abae
-		if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.8.1
385abae
+#		if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.8.1
385abae
 		;;
385abae
 	    aarch64*)
385abae
 		TLIBS="$TLIBS -lgcc_s";;
385abae
--- gcl-2.6.12.orig/configure.in
385abae
+++ gcl-2.6.12/configure.in
385abae
@@ -382,7 +382,7 @@ case $use in
385abae
 	case $use in
385abae
 	    alpha*)
385abae
 		assert_arg_to_cflags -mieee
385abae
-		if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.8.1
385abae
+#		if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.8.1
385abae
 		;;
385abae
 	    aarch64*)
385abae
 		TLIBS="$TLIBS -lgcc_s";;
385abae
--- gcl-2.6.12.orig/h/elf64_alpha_reloc.h
385abae
+++ gcl-2.6.12/h/elf64_alpha_reloc.h
385abae
@@ -1,5 +1,5 @@
385abae
     case R_ALPHA_GPDISP:
385abae
-      gotoff=(ul)(got+(a>>32));
385abae
+      gotoff=(ul)(got+(a>>32)-1);
385abae
       s=gotoff-p;
385abae
       store_val(where,MASK(16),(s-(short)s)>>16);
385abae
       store_val((void *)where+(a&MASK(32)),MASK(16),s);
385abae
@@ -23,7 +23,7 @@
385abae
       s+=a&MASK(32);
385abae
       a=(a>>32)-1;
385abae
       if (s>=ggot1 && s
385abae
-        massert(!write_stub(s,(ul *)gotoff,got+a));
385abae
+        massert(!write_stub(s,got+a));
385abae
       } else 
385abae
         got[a]=s;
385abae
       store_vals(where,MASK(16),(ul)(got+a)-gotoff);
385abae
--- gcl-2.6.12.orig/h/elf64_alpha_reloc_special.h
385abae
+++ gcl-2.6.12/h/elf64_alpha_reloc_special.h
385abae
@@ -1,16 +1,16 @@
385abae
 static ul ggot1,ggote,gotoff;
385abae
 
385abae
 static int
385abae
-write_stub(ul s,ul *got,ul *gote) {
385abae
+write_stub(ul s,ul *gote) {
385abae
 
385abae
   unsigned int *goti;
385abae
 
385abae
   *gote=(ul)(goti=(void *)(gote+2));
385abae
   *++gote=s;
385abae
-  *goti++=(0x29<<26)|(0x1b<<21)|(0x1d<<16)|((void *)gote-(void *)got);
385abae
-  *goti++=(0x29<<26)|(0x1b<<21)|(0x1b<<16)|0;
385abae
-  *goti++=(0x1a<<26)|(0x1f<<21)|(0x1b<<16)|0x4000;
385abae
-  *goti++=0;
385abae
+  *goti++=(0x29<<26)|(0x1b<<21)|(0x1b<<16)|0xfff8; /*ldq	t12,-8(t12)*/
385abae
+  *goti++=(0x29<<26)|(0x1b<<21)|(0x1b<<16)|0;      /*ldq	t12,0(t12)*/
385abae
+  *goti++=(0x1a<<26)|(0x1f<<21)|(0x1b<<16)|0x4000; /*jsr	zero,(t12),$pc+4*/
385abae
+  *goti++=0;                                       /*halt*/
385abae
 
385abae
   return 0;
385abae
   
385abae
@@ -94,7 +94,10 @@ label_got_symbols(void *v1,Shdr *sec1,Sh
385abae
 
385abae
 	    q=++*gs;
385abae
 
385abae
-	  massert(!(r->r_addend>>32));
385abae
+	  if (r->r_addend>>32)
385abae
+	    fprintf(stderr,"zeroing high addend %lx\n",r->r_addend>>32);
385abae
+	  r->r_addend&=0xffffffff;
385abae
+	  massert((q&0xffffffff)==q);
385abae
 	  r->r_addend|=(q<<32);
385abae
 
385abae
 	  q=(q-gotp)*sizeof(*gs);
385abae
@@ -111,6 +114,10 @@ label_got_symbols(void *v1,Shdr *sec1,Sh
385abae
 	    gotp=*gs+1;
385abae
 	  }
385abae
 
385abae
+	  if (r->r_addend>>32)
385abae
+	    fprintf(stderr,"zeroing high addend %lx\n",r->r_addend>>32);
385abae
+	  r->r_addend&=0xffffffff;
385abae
+	  massert((gotp&0xffffffff)==gotp);
385abae
 	  r->r_addend|=(gotp<<32);
385abae
 
385abae
 	  break;