[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] i386 build of gawk with tcc now broken
From: |
Ramsay Jones |
Subject: |
Re: [Tinycc-devel] i386 build of gawk with tcc now broken |
Date: |
Sun, 08 Sep 2013 17:13:51 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 |
On 08/09/13 08:00, address@hidden wrote:
>>> After pulling the latest on the mob branch, builds of gawk master using
>>> tcc generate lots of test failures.
>>>
>>> On an i386 linux system:
>>>
>>> git clone git://git.savannah.gnu.org/gawk.git
>>> cd gawk
>>> ./bootstrap.sh && configure CC=tcc && make
>>> make check # watch lots of things go kablooey
>>>
>>> This does not occur on x86-64.
>>
>> Does this also happen with tcc 0.9.26 and tcc 0.9.25 or just with the mob
>> branch?
>
> I'm pretty sure just the mob branch. I can double check tomorrow
> when I'm at the machine. Almost all the errors are related to floating
> point exceptions; I strongly suspect it has to do with the most recent
> changes.
>
> The recipe above will let you reproduce it a lot quicker than waiting
> for me...
>
> 0.9.25 won't be worth checking as it's tool old, FWIW.
I have a patch to fix the tests, which fail for me with a Floating
point exception:
address@hidden $ make test
:
[snip]
:
------------ test3 ------------
../tcc -B.. -I.. -I.. -I../include -DCONFIG_LDDIR="\"lib/i386-linux-gnu\""
-DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE
-run
../tcc.c -B.. -I.. -I.. -I../include -DCONFIG_LDDIR="\"lib/i386-linux-gnu\""
-DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE
-run
../tcc.c -B.. -I.. -I.. -I../include -DCONFIG_LDDIR="\"lib/i386-linux-gnu\""
-DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE
-run
../tcc.c -B.. -I.. -I.. -I../include -run ../tests/tcctest.c > test.out3
Floating point exception
make[1]: *** [test3] Error 136
make[1]: Leaving directory `/home/ramsay/tinycc/tests'
make: *** [test] Error 2
address@hidden $
If you run 'git bisect' you will find the culprit is commit 73faaea2
("i386-gen: preserve fp control word in gen_cvt_ftoi", 28-08-2013).
Try the following patch and let me know if it fixes it up for you.
ATB,
Ramsay Jones
--- 8< ---
From: Ramsay Jones <address@hidden>
Date: Sat, 7 Sep 2013 22:48:02 +0100
Subject: [PATCH] libtcc1.c: Fix __asm__() in __tcc_fpinit and __tcc_cvt_ftol
Signed-off-by: Ramsay Jones <address@hidden>
---
lib/libtcc1.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/libtcc1.c b/lib/libtcc1.c
index a94a82d..a717701 100644
--- a/lib/libtcc1.c
+++ b/lib/libtcc1.c
@@ -482,7 +482,7 @@ long long __ashldi3(long long a, int b)
void __tcc_fpinit(void)
{
unsigned c = 0x137F;
- __asm__ __volatile__ ("fldcw %0" : "=m" (c));
+ __asm__ __volatile__ ("fldcw %0" : : "m" (c));
}
#endif
long long __tcc_cvt_ftol(long double x)
@@ -491,9 +491,9 @@ long long __tcc_cvt_ftol(long double x)
long long ret;
__asm__ __volatile__ ("fnstcw %0" : "=m" (c0));
c1 = c0 | 0x0C00;
- __asm__ __volatile__ ("fldcw %0" : "=m" (c1));
+ __asm__ __volatile__ ("fldcw %0" : : "m" (c1));
__asm__ __volatile__ ("fistpll %0" : "=m" (ret));
- __asm__ __volatile__ ("fldcw %0" : "=m" (c0));
+ __asm__ __volatile__ ("fldcw %0" : : "m" (c0));
return ret;
}
#endif /* !__x86_64__ */
--
1.8.4