On Sat, Jul 21, 2012 at 04:37:57PM +0000, Paul Tagliamonte wrote:
> tags 681281 + pending
> thanks
> 
> I've tested a fix from RoboTux,
> 
> | [tag@urial:~/tmp][04:33 PM]$ ./test.sh
> | tcc @ 0.9.26~git20120612.ad5f375-5
> | testing with gcc ... 2
> | testing with tcc ... 0
> | testing with clang ... 2
> | [tag@urial:~/tmp][04:33 PM]$ ./test.sh
> | tcc @ 0.9.26~git20120612.ad5f375-6
> | testing with gcc ... 2
> | testing with tcc ... 2
> | testing with clang ... 2
> | [tag@urial:~/tmp][04:35 PM]$ cat test.sh
> | #!/bin/bash
> |
> | echo "tcc @ `dpkg -l | grep \ tcc | awk '{print $3}'`"
> |
> | for cmp in gcc tcc clang; do
> |     echo -n "testing with $cmp ... "
> |     $cmp test.c -o test
> |     ./test
> |     echo "$?"
> |     rm test
> | done
> 
> Since RoboTux is away from his machine, he has given me consent to upload on 
> his
> behalf.
> 
> Upload pending.
> 
> Thanks,
>   Paul
> 
> --
>  .''`.  Paul Tagliamonte <[email protected]>
> : :'  : Proud Debian Developer
> `. `'`  4096R / 8F04 9AD8 2C92 066C 7352  D28A 7B58 5B30 807C 2A87
>  `-     http://people.debian.org/~paultag

Uploaded. Debdiff attached.

Thanks, folks!

-- 
 .''`.  Paul Tagliamonte <[email protected]>
: :'  : Proud Debian Developer
`. `'`  4096R / 8F04 9AD8 2C92 066C 7352  D28A 7B58 5B30 807C 2A87
 `-     http://people.debian.org/~paultag
diff -Nru tcc-0.9.26~git20120612.ad5f375/debian/changelog 
tcc-0.9.26~git20120612.ad5f375/debian/changelog
--- tcc-0.9.26~git20120612.ad5f375/debian/changelog     2012-07-09 
13:30:35.000000000 +0000
+++ tcc-0.9.26~git20120612.ad5f375/debian/changelog     2012-07-21 
16:41:21.000000000 +0000
@@ -1,3 +1,17 @@
+tcc (0.9.26~git20120612.ad5f375-6) unstable; urgency=low
+
+  [Paul Tagliamonte]
+    * Uploading Tom's fixes on his behalf. Although he's signed this upload
+      (he issued a debdiff), I've prepared this upload. Fix verified on
+      i386.
+
+  [Thomas Preud'homme]
+    * debian/patches:
+      + Fix incorrect reading of long long values on architecture with 32bits
+        registers like i386 and armel (Closes: #681281).
+
+ -- Thomas Preud'homme <[email protected]>  Sat, 21 Jul 2012 03:43:35 +0200
+
 tcc (0.9.26~git20120612.ad5f375-5) unstable; urgency=low
 
   * debian/patches:
diff -Nru 
tcc-0.9.26~git20120612.ad5f375/debian/patches/0006-get_reg-try-to-free-r2-for-an-SValue-first.patch
 
tcc-0.9.26~git20120612.ad5f375/debian/patches/0006-get_reg-try-to-free-r2-for-an-SValue-first.patch
--- 
tcc-0.9.26~git20120612.ad5f375/debian/patches/0006-get_reg-try-to-free-r2-for-an-SValue-first.patch
 1970-01-01 00:00:00.000000000 +0000
+++ 
tcc-0.9.26~git20120612.ad5f375/debian/patches/0006-get_reg-try-to-free-r2-for-an-SValue-first.patch
 2012-07-21 16:31:29.000000000 +0000
@@ -0,0 +1,51 @@
+From 315185fe1db1296e511bec15894dad22432c9a7f Mon Sep 17 00:00:00 2001
+From: Thomas Preud'homme <[email protected]>
+Date: Sat, 21 Jul 2012 03:36:51 +0200
+Subject: get_reg(): try to free r2 for an SValue first
+
+To be able to load a long long value correctly on i386, gv() rely on the
+fact that when get_reg() look at an SValue it tries first to free the
+register in r2 and then r. More information about the context can be
+found at
+http://lists.nongnu.org/archive/html/tinycc-devel/2012-06/msg00017.html
+and later at
+http://lists.nongnu.org/archive/html/tinycc-devel/2012-07/msg00021.html
+
+Origin: 
upstream,http://repo.or.cz/w/tinycc.git/commit/d1694f7d7e6d96f64d1330c9b43491b613272b1e
+Bug-Debian: http://bugs.debian.org/681281
+Forwarded: 
http://lists.nongnu.org/archive/html/tinycc-devel/2012-06/msg00017.html
+Last-Updated: 2012-07-21
+Applied-Upstream: commit:d1694f7d7e6d96f64d1330c9b43491b613272b1e
+---
+ tccgen.c |    9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/tccgen.c b/tccgen.c
+index d27bdba..71d0809 100644
+--- a/tccgen.c
++++ b/tccgen.c
+@@ -589,11 +589,11 @@ ST_FUNC int get_reg(int rc)
+        IMPORTANT to start from the bottom to ensure that we don't
+        spill registers used in gen_opi()) */
+     for(p=vstack;p<=vtop;p++) {
+-        r = p->r & VT_VALMASK;
++        /* look at second register (if long long) */
++        r = p->r2 & VT_VALMASK;
+         if (r < VT_CONST && (reg_classes[r] & rc))
+             goto save_found;
+-        /* also look at second register (if long long) */
+-        r = p->r2 & VT_VALMASK;
++        r = p->r & VT_VALMASK;
+         if (r < VT_CONST && (reg_classes[r] & rc)) {
+         save_found:
+             save_reg(r);
+@@ -812,7 +812,8 @@ ST_FUNC int gv(int rc)
+                     vtop[-1].r = r; /* save register value */
+                     vtop->r = vtop[-1].r2;
+                 }
+-                /* allocate second register */
++                /* Allocate second register. Here we rely on the fact that
++                   get_reg() tries first to free r2 of an SValue. */
+                 r2 = get_reg(rc2);
+                 load(r2, vtop);
+                 vpop();
diff -Nru tcc-0.9.26~git20120612.ad5f375/debian/patches/series 
tcc-0.9.26~git20120612.ad5f375/debian/patches/series
--- tcc-0.9.26~git20120612.ad5f375/debian/patches/series        2012-07-09 
13:30:35.000000000 +0000
+++ tcc-0.9.26~git20120612.ad5f375/debian/patches/series        2012-07-21 
16:31:29.000000000 +0000
@@ -3,3 +3,4 @@
 0003-Detect-multiarch-on-Kfreebsd-and-Hurd.patch
 0004-Disable-callsave_test-test-on-arm.patch
 0005-Incorrect-shift-result-type-with-64-bit-ABI.patch
+0006-get_reg-try-to-free-r2-for-an-SValue-first.patch

Attachment: signature.asc
Description: Digital signature

Reply via email to