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
This commit is contained in:
Jakub Jelinek 2011-04-23 12:18:03 +02:00 committed by Jakub Jelinek
parent ff9419990b
commit 16997bc011
4 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,9 @@
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.

View File

@ -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:

View File

@ -1,3 +1,8 @@
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.

View File

@ -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;
}