[Top][All Lists]

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

Re: [Tinycc-devel] Regarding Long double Constant

From: Ayush Varshney
Subject: Re: [Tinycc-devel] Regarding Long double Constant
Date: Thu, 11 Feb 2021 09:31:45 +0100

[1] https://www.researchgate.net/publication/245578769_Fully_Countering_Trusting_Trust_through_Diverse_Double-Compiling

On Thu, Feb 11, 2021 at 9:27 AM 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 and please let me know if you have any queries regarding it.


reply via email to

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