* gimplify.c (gimplify_cond_expr): Gimplify COMPOUND_EXPR conditions.
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 22 Mar 2011 10:14:07 +0000 (10:14 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 22 Mar 2011 10:14:07 +0000 (10:14 +0000)
From-SVN: r171282

gcc/ChangeLog
gcc/gimplify.c

index d164a0218f691d6a02460180407b0bc709710a33..c6d5fe915b0463da05a596ec2d773bad5cf64bc2 100644 (file)
@@ -1,3 +1,7 @@
+2011-03-22  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gimplify.c (gimplify_cond_expr): Gimplify COMPOUND_EXPR conditions.
+
 2011-03-22  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        * config/s390/s390.c (s390_delegitimize_address): Fix offset
index c034ec29228061f37e359599e9aec923711b87fc..e48409d4a7469bb7172c9c6f71dc96d32c3d411b 100644 (file)
@@ -2992,6 +2992,11 @@ gimplify_cond_expr (tree *expr_p, gimple_seq *pre_p, fallback_t fallback)
       return GS_ALL_DONE;
     }
 
+  /* Remove any COMPOUND_EXPR so the following cases will be caught.  */
+  STRIP_TYPE_NOPS (TREE_OPERAND (expr, 0));
+  if (TREE_CODE (TREE_OPERAND (expr, 0)) == COMPOUND_EXPR)
+    gimplify_compound_expr (&TREE_OPERAND (expr, 0), pre_p, true);
+
   /* Make sure the condition has BOOLEAN_TYPE.  */
   TREE_OPERAND (expr, 0) = gimple_boolify (TREE_OPERAND (expr, 0));