Fix false positive for -Walloc-size-larger-than (PR bootstrap/79132).

2017-01-24  Martin Liska  <mliska@suse.cz>

	PR bootstrap/79132
	* tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Insert assert
	that would prevent us to call alloca with -1 as argument.

From-SVN: r244857
This commit is contained in:
Martin Liska 2017-01-24 09:48:36 +01:00 committed by Martin Liska
parent c3b3e526fd
commit ad8040243a
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2017-01-24 Martin Liska <mliska@suse.cz>
PR bootstrap/79132
* tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Insert assert
that would prevent us to call alloca with -1 as argument.
2017-01-24 Jakub Jelinek <jakub@redhat.com> 2017-01-24 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (output_compilation_unit_header, output_file_names): * dwarf2out.c (output_compilation_unit_header, output_file_names):

View File

@ -4407,6 +4407,7 @@ rewrite_expr_tree_parallel (gassign *stmt, int width,
{ {
enum tree_code opcode = gimple_assign_rhs_code (stmt); enum tree_code opcode = gimple_assign_rhs_code (stmt);
int op_num = ops.length (); int op_num = ops.length ();
gcc_assert (op_num > 0);
int stmt_num = op_num - 1; int stmt_num = op_num - 1;
gimple **stmts = XALLOCAVEC (gimple *, stmt_num); gimple **stmts = XALLOCAVEC (gimple *, stmt_num);
int op_index = op_num - 1; int op_index = op_num - 1;