Commit dd373780 by Chris Manghane Committed by Ian Lance Taylor

re PR go/61204 (gccgo: ICE in in fold_convert_loc [GoSmith])

	PR go/61204
	* go-gcc.cc (Gcc_backend::temporary_variable): Don't initialize
	zero-sized variable.

From-SVN: r219316
parent 649a2749
2015-01-07 Chris Manghane <cmang@google.com>
PR go/61204
* go-gcc.cc (Gcc_backend::temporary_variable): Don't initialize
zero-sized variable.
2015-01-06 Chris Manghane <cmang@google.com> 2015-01-06 Chris Manghane <cmang@google.com>
* go-gcc.cc (constructor_expression): Don't initialize zero-sized * go-gcc.cc (Gcc_backend::constructor_expression): Don't
fields, just evaluate the values for side effects. initialize zero-sized fields, just evaluate the values for side
effects.
2015-01-05 Jakub Jelinek <jakub@redhat.com> 2015-01-05 Jakub Jelinek <jakub@redhat.com>
...@@ -11,8 +18,8 @@ ...@@ -11,8 +18,8 @@
2014-12-19 Chris Manghane <cmang@google.com> 2014-12-19 Chris Manghane <cmang@google.com>
* go-gcc.cc (array_constructor_expression): Don't construct arrays * go-gcc.cc (Gcc_backend::array_constructor_expression): Don't
of zero-sized values. construct arrays of zero-sized values.
2014-10-29 Richard Sandiford <richard.sandiford@arm.com> 2014-10-29 Richard Sandiford <richard.sandiford@arm.com>
......
...@@ -2536,7 +2536,7 @@ Gcc_backend::temporary_variable(Bfunction* function, Bblock* bblock, ...@@ -2536,7 +2536,7 @@ Gcc_backend::temporary_variable(Bfunction* function, Bblock* bblock,
BIND_EXPR_VARS(bind_tree) = BLOCK_VARS(block_tree); BIND_EXPR_VARS(bind_tree) = BLOCK_VARS(block_tree);
} }
if (init_tree != NULL_TREE) if (this->type_size(btype) != 0 && init_tree != NULL_TREE)
DECL_INITIAL(var) = fold_convert_loc(location.gcc_location(), type_tree, DECL_INITIAL(var) = fold_convert_loc(location.gcc_location(), type_tree,
init_tree); init_tree);
...@@ -2546,6 +2546,13 @@ Gcc_backend::temporary_variable(Bfunction* function, Bblock* bblock, ...@@ -2546,6 +2546,13 @@ Gcc_backend::temporary_variable(Bfunction* function, Bblock* bblock,
*pstatement = this->make_statement(build1_loc(location.gcc_location(), *pstatement = this->make_statement(build1_loc(location.gcc_location(),
DECL_EXPR, DECL_EXPR,
void_type_node, var)); void_type_node, var));
// Don't initialize VAR with BINIT, but still evaluate BINIT for
// its side effects.
if (this->type_size(btype) == 0 && init_tree != NULL_TREE)
*pstatement = this->compound_statement(this->expression_statement(binit),
*pstatement);
return new Bvariable(var); return new Bvariable(var);
} }
......
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