Fix comparing comparisons
commit9ca9c82ff8a4001299a4b9666d85352f5806d565
authorMichael Matz <matz@suse.de>
Mon, 16 Apr 2012 00:52:15 +0000 (16 02:52 +0200)
committerMichael Matz <matz@suse.de>
Wed, 18 Apr 2012 18:57:14 +0000 (18 20:57 +0200)
treecccd695d9db32bcba58c89a614eee9f5564371a5
parent718fd591fa93ff254a9ca68a0ad2ff8a55756489
Fix comparing comparisons

Sometimes the result of a comparison is not directly used in a jump,
but in arithmetic or further comparisons.  If those further things
do a vswap() with the VT_CMP as current top, and then generate
instructions for the new top, this most probably destroys the flags
(e.g. if it's a bitfield load like in the example).

vswap() must do the same like vsetc() and not allow VT_CMP vtops
to be moved down.
tccgen.c
tests/tcctest.c