[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Regarding Long double Constant
From: |
Christian Jullien |
Subject: |
Re: [Tinycc-devel] Regarding Long double Constant |
Date: |
Thu, 11 Feb 2021 13:49:48 +0100 |
No, I think he probably meant (1F-1F) to get 0.0F value?
-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange.fr@nongnu.org] On
Behalf Of Kyryl Melekhin
Sent: Thursday, February 11, 2021 08:36
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] Regarding Long double Constant
Ayush Varshney <varshneyayush90@gmail.com> wrote:
> Hi everyone,
> Hope you all are doing well!!
> I am new to the tinycc community.
> I was working over Diverse Double-compiling technique [1]. And found there
> is a bad optimization performed by tcc. The problem is called Long double
> constant problem.
>
> *Long double constant problem* is for storing the value of 0.0, tcc stores
> 0.0 in memory as
> long double value but long double value in tcc takes only 10 bytes but the
> source code
> stores 0.0 value in 12 bytes. The extra two bytes creates variations in the
> output. The
> problem is solved using (f1-f1) instead of 0.0, it is semantically same and
> produces the
> same output. For example,
> Instead of *if(f2==0.0)* use *if(f2==f1-f1)*
>
> I have pushed my solution
> <https://repo.or.cz/tinycc.git/commit/405aef9155fb66e280dac82ce521d5d2ea06f2ab>
> and please let me know if you have any queries regarding it.
>
> Regards
> Ayush
Hello Ayush,
tccgen.c:8105:41: error: 'f1' undeclared (first use in this function); did you
mean 'y1'?
8105 | else if (vtop->c.ld == (f1-f1) )
| ^~
| y1
I don't know where you found f1 in that
function but the build is broken right now.
Typo?
Regards.
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
- [Tinycc-devel] Regarding Long double Constant, Ayush Varshney, 2021/02/11
- Re: [Tinycc-devel] Regarding Long double Constant, Ayush Varshney, 2021/02/11
- Re: [Tinycc-devel] Regarding Long double Constant, Vincent Lefevre, 2021/02/11
- Re: [Tinycc-devel] Regarding Long double Constant, Kyryl Melekhin, 2021/02/11
- Re: [Tinycc-devel] Regarding Long double Constant,
Christian Jullien <=
- Re: [Tinycc-devel] Regarding Long double Constant, Vincent Lefevre, 2021/02/11
- Re: [Tinycc-devel] Regarding Long double Constant, Kyryl Melekhin, 2021/02/11
- Re: [Tinycc-devel] Regarding Long double Constant, Ayush Varshney, 2021/02/11
- Re: [Tinycc-devel] Regarding Long double Constant, Elijah Stone, 2021/02/11
- Re: [Tinycc-devel] Regarding Long double Constant, Ayush Varshney, 2021/02/11