From: Jakub Jelinek Date: Sat, 23 Apr 2011 10:18:03 +0000 (+0200) Subject: re PR c/48685 (ICE in gimplify_expr, at gimplify.c:7034) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=16997bc01128f46cee9450237cd5e3e8fb3b12ad;p=gcc.git re PR c/48685 (ICE in gimplify_expr, at gimplify.c:7034) 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index edff5052b18..4d7c511ccbe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-04-23 Jakub Jelinek + + 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 * gensupport.c (read_md_rtx): Fix typo in comment. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index c4bf08819b3..8f90f6f108a 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2029,8 +2029,6 @@ fold_convert_loc (location_t loc, tree type, tree arg) 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: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 40b9e6d5900..08aa6d48241 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-04-23 Jakub Jelinek + + PR c/48685 + * gcc.dg/pr48685.c: New test. + 2011-04-22 Jan Hubicka * gcc.dg/tree-ssa/pr38699.c: Fix testcase. diff --git a/gcc/testsuite/gcc.dg/pr48685.c b/gcc/testsuite/gcc.dg/pr48685.c new file mode 100644 index 00000000000..36df0cc5f31 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48685.c @@ -0,0 +1,11 @@ +/* PR c/48685 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int +main () +{ + int v = 1; + (void) (1 == 2 ? (void) 0 : (v = 0)); + return v; +}