[Top][All Lists]

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

[Tinycc-devel] Fix bug in ||, &&, ! (save registers through jumps), gr

From: David A. Wheeler
Subject: [Tinycc-devel] Fix bug in ||, &&, ! (save registers through jumps), grischka-2005-09-25 case_2
Date: Thu, 03 May 2007 01:17:43 -0400 (EDT)

Another tcc patch!  Here's what this one does:

Fix bug in ||, &&, ! (save registers through jumps), grischka-2005-09-25 case_2
This saves registers through jumps with ||, &&, and !.
This patch was originally posted in grischka's 2005-09-25 email as
"required fix" case_2 to compile gcc 2.95. It was tweaked by
David A. Wheeler to merge the test case into the standard tcc test suite.
The original test case only tested || (case 2.1) and ! (case 2.2);
Wheeler added the test cases for && (which happens to completely crash
the unpatched compiler at compiler time - pretty solid evidence of
a problem in the unpatched program!).

Without this patch, || and ! can get the wrong answer in some cases (pretty 
hideous!), and uses of && can even cause tcc to crash while compiling something.

BTW, as usual, I include BOTH the test cases AND the fix in the patch.  As 
usual I wrote the test cases first, to make sure that there was a problem, and 
then added the fixes to make sure that the fix ACTUALLY fixed the problem.  
This particular patch simply forces saving of registers in some cases, so it 
SHOULDN'T make anything else break, but certainly let me know of a problem.

--- David A. Wheeler 

Attachment: grischka2.patch
Description: Text Data

reply via email to

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