Commit 8c50b495 by Jakub Jelinek Committed by Jakub Jelinek

re PR c/37529 (ICE with invalid goto)

	PR c/37529
	* gimplify.c (gimplify_expr) <case GOTO_EXPR>: If gimplification of
	GOTO_DESTINATION failed, don't create GIMPLE_GOTO.

	* gcc.dg/pr37529.c: New test.

From-SVN: r140402
parent cc8b343d
2008-09-16 Jakub Jelinek <jakub@redhat.com>
PR c/37529
* gimplify.c (gimplify_expr) <case GOTO_EXPR>: If gimplification of
GOTO_DESTINATION failed, don't create GIMPLE_GOTO.
PR c++/37530
* gimplify.c (gimplify_expr) <case TRY_CATCH_EXPR>: Don't create
GIMPLE_TRY if cleanup sequence is empty.
......
......@@ -6483,8 +6483,12 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
/* If the target is not LABEL, then it is a computed jump
and the target needs to be gimplified. */
if (TREE_CODE (GOTO_DESTINATION (*expr_p)) != LABEL_DECL)
{
ret = gimplify_expr (&GOTO_DESTINATION (*expr_p), pre_p,
NULL, is_gimple_val, fb_rvalue);
if (ret == GS_ERROR)
break;
}
gimplify_seq_add_stmt (pre_p,
gimple_build_goto (GOTO_DESTINATION (*expr_p)));
break;
......
2008-09-16 Jakub Jelinek <jakub@redhat.com>
PR c/37529
* gcc.dg/pr37529.c: New test.
PR c++/37530
* g++.dg/parse/crash48.C: New test.
......
/* PR c/37529 */
/* { dg-do compile } */
/* { dg-options "-std=gnu89" } */
void
foo ()
{
goto *; /* { dg-error "expected expression before" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment