[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] Fix bug in ||, &&, ! (save registers through jumps), gr
David A. Wheeler
[Tinycc-devel] Fix bug in ||, &&, ! (save registers through jumps), grischka-2005-09-25 case_2
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
Description: Text Data
- [Tinycc-devel] Fix bug in ||, &&, ! (save registers through jumps), grischka-2005-09-25 case_2,
David A. Wheeler <=