PR c/48685
* fold-const.c (fold_convert_loc): Add NOP_EXPR when casting
to VOID_TYPE even around MODIFY_EXPR.
* gcc.dg/pr48685.c: New test.
From-SVN: r172895
+2011-04-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/48685
+ * fold-const.c (fold_convert_loc): Add NOP_EXPR when casting
+ to VOID_TYPE even around MODIFY_EXPR.
+
2011-04-22 Mike Stump <mikestump@comcast.net>
* gensupport.c (read_md_rtx): Fix typo in comment.
case VOID_TYPE:
tem = fold_ignored_result (arg);
- if (TREE_CODE (tem) == MODIFY_EXPR)
- goto fold_convert_exit;
return fold_build1_loc (loc, NOP_EXPR, type, tem);
default:
+2011-04-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/48685
+ * gcc.dg/pr48685.c: New test.
+
2011-04-22 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
--- /dev/null
+/* PR c/48685 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+main ()
+{
+ int v = 1;
+ (void) (1 == 2 ? (void) 0 : (v = 0));
+ return v;
+}