[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Bug in tcc

From: Philippe Ribet
Subject: Re: [Tinycc-devel] Bug in tcc
Date: Mon, 25 Sep 2006 07:56:50 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5

Daniel Glöckner wrote:

Patch is attached.

save_reg tried to save a floating point value from the value stack
because its r2 contained 0 (== TREG_EAX), but r2 is valid only for


diff -rud a/tcc.c b/tcc.c
--- a/tcc.c     Sun Sep 24 18:34:55 2006
+++ b/tcc.c     Sun Sep 24 18:35:16 2006
@@ -4585,7 +4585,8 @@
    l = 0;
    for(p=vstack;p<=vtop;p++) {
        if ((p->r & VT_VALMASK) == r ||
-            (p->r2 & VT_VALMASK) == r) {
+           ((p->type.t & VT_BTYPE) == VT_LLONG &&
+            (p->r2 & VT_VALMASK) == r)) {
            /* must save value on stack if not already done */
            if (!saved) {
                /* NOTE: must reload 'r' because r might be equal to r2 */
Thank you very very very much Daniel for this patch.

After you sent your first mail, I started to look at fstl and co. But I do not know anything at x86 fpu programming. When you sent this mail with the patch, I was far from looking at the compiler source code.

Of course this works fine! I'm now on the way for the next bug isolation...

Thanks again,

Philippe Ribet

                        The README file said
             "Requires Windows 95, NT 4.0, or better."
                   So... I installed it on Linux!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]