On Wed, May 18, 2011 at 8:30 PM, Kai Tietz <ktiet...@googlemail.com> wrote:
> 2011/5/18 Kai Tietz <ktiet...@googlemail.com>:
>> Hello
>>
>> As follow-up for logical to binary transition
>>
>> 2011-05-18  Kai Tietz  <kti...@redhat.com>
>>
>>        * tree-cfg.c (verify_gimple_assign_binary): Barf on
>>        TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
>>        (gimplify_expr): Boolify TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR,
>>        TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR. Additionally
>>        move TRUTH_AND|OR|XOR_EXPR to its binary form.
>>
>> Boostrapped for x86_64-pc-linux-gnu and regression tested for ada,
>> fortran, g++, and c. Ok for apply?
>
> Additional bootstrapped and regression tested for java, obj-c, and
> obj-c++. Regression tested alos libstdc++ and libjava. No regressions.

Please put a comment before

+
+       switch (TREE_CODE (*expr_p))
+         {
+         case TRUTH_AND_EXPR:
+           TREE_SET_CODE (*expr_p, BIT_AND_EXPR);
+           break;
+         case TRUTH_OR_EXPR:
+           TREE_SET_CODE (*expr_p, BIT_IOR_EXPR);
+           break;
+         case TRUTH_XOR_EXPR:
+           TREE_SET_CODE (*expr_p, BIT_XOR_EXPR);
+           break;
+         default:
+           break;
+         }

like

/* With two-valued operand types binary truth expressions are
   semantically equivalent to bitwise binary expressions.  Canonicalize
   them to the bitwise variant.  */

Eric, how will this interact with Ada boolean types with 8 bit precision
and those "invalid" values - will invalid values ever enter into
expressions or are they checked before?  Can you think of something
that would break with s/TRUTH_*_EXPR/BIT_*_EXPR/ for Ada?

Thanks,
Richard.

> Regards,
> Kai
>

Reply via email to