On Wed, May 11, 2011 at 12:03 PM, Kai Tietz <ktiet...@googlemail.com> wrote: > 2011/5/11 Eric Botcazou <ebotca...@adacore.com>: >>> this patch converts TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR >>> expressions on gimplification to their binary form. >> >> What is it for? This will redirect the compilation stream from proven paths >> to >> others so there must be a good reason to do it. What's the effect on the >> code? >> >> -- >> Eric Botcazou > > Well, it would have some effects. First we don't need to handle TRUTH > and BINARY variants of AND, OR, XOR any longer special. Second cause > is that on BINARY trees the reassociation pass can operate, which > leads to better optimized boolean logic.
The most important thing is to get predicate types sane - that affects tcc_comparison codes and the TRUTH_* codes. After that, the TRUTH_* codes are redundant with the BIT_* ones which already are always validly typed. As fold already converts some TRUTH_* to BIT_* variants we usually have a mix of both which is not handled very well by tree optimizers. Richard. > Regards, > Kai >