Hello,

this patch fixes the issue reported in PR/48984.  Issue is that
fortran has multiple BOOLEAN_TYPE'ed types with different modes. So
the check for BOOLEAN_TYPE in gimplification is wrong and instead we
need to check for identify to boolean_type_node.

ChangeLog

2011-05-13  Kai Tietz

        * gimplify.c (gimplify_expr): Check for boolean_type_node instead
        for BOOLEAN_TYPE for TRUTH-NOT/AND/OR/XOR.
        (gimple_boolify): Check for cast for boolean_type_node instead for
        BOOLEAN_TYPE.

Bootstrap passed and now doing fortran testsuite run to verify.

Regards,
Kai

Index: gimplify.c
===================================================================
--- gimplify.c  (revision 173711)
+++ gimplify.c  (working copy)
@@ -2848,7 +2848,7 @@
     default:
       /* Other expressions that get here must have boolean values, but
         might need to be converted to the appropriate mode.  */
-      if (TREE_CODE (type) == BOOLEAN_TYPE)
+      if (type == boolean_type_node)
        return expr;
       return fold_convert_loc (loc, boolean_type_node, expr);
     }
@@ -6754,7 +6754,7 @@
          }

        case TRUTH_NOT_EXPR:
-         if (TREE_CODE (TREE_TYPE (*expr_p)) != BOOLEAN_TYPE)
+         if (TREE_TYPE (*expr_p) != boolean_type_node)
            {
              tree type = TREE_TYPE (*expr_p);
              *expr_p = fold_convert (type, gimple_boolify (*expr_p));
@@ -7199,7 +7199,7 @@
               fold_truth_not_expr) happily uses operand type and doesn't
               automatically uses boolean_type as result, we need to keep
               orignal type.  */
-           if (TREE_CODE (org_type) != BOOLEAN_TYPE)
+           if (org_type != boolean_type_node)
              {
                *expr_p = fold_convert (org_type, *expr_p);
                ret = GS_OK;

Reply via email to