From 98107def4d92f0f02d34c53e5971c5e68176815a Mon Sep 17 00:00:00 2001 From: rguenth Date: Fri, 4 Apr 2014 11:52:35 +0000 Subject: 2014-04-04 Richard Biener PR ipa/60746 * tree-ssanames.c (make_ssa_name_fn): Fix assert. * gimple.c (gimple_set_bb): Avoid ICEing for NULL cfun for non-GIMPLE_LABELs. * gimplify.h (gimple_add_tmp_var_fn): Declare. * gimplify.c (gimple_add_tmp_var_fn): New function. * gimple-expr.h (create_tmp_reg_fn): Declare. * gimple-expr.c (create_tmp_reg_fn): New function. * gimple-low.c (record_vars_into): Don't change cfun. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Fix code generation without cfun. * g++.dg/torture/pr60746.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209079 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/gimple.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/gimple.c') diff --git a/gcc/gimple.c b/gcc/gimple.c index e9851ca386a..2a278e41e9d 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1464,9 +1464,12 @@ gimple_set_bb (gimple stmt, basic_block bb) { stmt->bb = bb; + if (gimple_code (stmt) != GIMPLE_LABEL) + return; + /* If the statement is a label, add the label to block-to-labels map so that we can speed up edge creation for GIMPLE_GOTOs. */ - if (cfun->cfg && gimple_code (stmt) == GIMPLE_LABEL) + if (cfun->cfg) { tree t; int uid; -- cgit v1.2.1