tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] i386 build of gawk with tcc now broken


From: Aharon Robbins
Subject: Re: [Tinycc-devel] i386 build of gawk with tcc now broken
Date: Mon, 09 Sep 2013 20:32:11 +0200
User-agent: Heirloom mailx 12.5 6/20/10

Hi.

I applied this patch, rebuilt everything and ran.  Things are back to
what they used to be.  If the patch doesn't break anything else, it'd
be great if it were applied.

Much thanks!

Arnold

> Date: Sun, 08 Sep 2013 17:13:51 +0100
> From: Ramsay Jones <address@hidden>
> To: address@hidden
> CC: address@hidden
> Subject: Re: [Tinycc-devel] i386 build of gawk with tcc now broken
>
> 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



reply via email to

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