------- Comment #7 from rguenth at gcc dot gnu dot org  2010-06-16 11:35 -------
Obvious patch, removing the premature (and bogus) optimization:

Index: c-common.c
===================================================================
--- c-common.c  (revision 160826)
+++ c-common.c  (working copy)
@@ -3825,23 +3825,7 @@ c_common_truthvalue_conversion (location
                        inner);
            return truthvalue_true_node;
          }
-
-       /* If we still have a decl, it is possible for its address to
-          be NULL, so we cannot optimize.  */
-       if (DECL_P (inner))
-         {
-           gcc_assert (DECL_WEAK (inner));
-           break;
-         }
-
-       if (TREE_SIDE_EFFECTS (inner))
-         {
-           expr = build2 (COMPOUND_EXPR, truthvalue_type_node,
-                          inner, truthvalue_true_node);
-           goto ret;
-         }
-       else
-         return truthvalue_true_node;
+       break;
       }

     case COMPLEX_EXPR:


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44555

Reply via email to