From ad8040243acd2a909b61b5690f7dac9ae362c945 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 24 Jan 2017 09:48:36 +0100 Subject: [PATCH] Fix false positive for -Walloc-size-larger-than (PR bootstrap/79132). 2017-01-24 Martin Liska 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 --- gcc/ChangeLog | 6 ++++++ gcc/tree-ssa-reassoc.c | 1 + 2 files changed, 7 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d97220b5352..bec27d3d992 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-01-24 Martin Liska + + 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 * dwarf2out.c (output_compilation_unit_header, output_file_names): diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 503edd3870d..4a796f48864 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -4407,6 +4407,7 @@ rewrite_expr_tree_parallel (gassign *stmt, int width, { enum tree_code opcode = gimple_assign_rhs_code (stmt); int op_num = ops.length (); + gcc_assert (op_num > 0); int stmt_num = op_num - 1; gimple **stmts = XALLOCAVEC (gimple *, stmt_num); int op_index = op_num - 1; -- 2.30.2