From 8410f2e87ab8f15a4b7fc8c870a38f45ad7f7f8e Mon Sep 17 00:00:00 2001 From: zrj Date: Thu, 26 Apr 2018 13:35:33 +0300 Subject: [PATCH] gcc47: Fix false positive for -Walloc-size-large-than. Backport fix for PR 79132, prevent using alloca(-1). --- contrib/gcc-4.7/gcc/tree-ssa-reassoc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/gcc-4.7/gcc/tree-ssa-reassoc.c b/contrib/gcc-4.7/gcc/tree-ssa-reassoc.c index 554ba3abe7..68493ad579 100644 --- a/contrib/gcc-4.7/gcc/tree-ssa-reassoc.c +++ b/contrib/gcc-4.7/gcc/tree-ssa-reassoc.c @@ -2312,6 +2312,7 @@ rewrite_expr_tree_parallel (gimple stmt, int width, { enum tree_code opcode = gimple_assign_rhs_code (stmt); int op_num = VEC_length (operand_entry_t, ops); + gcc_assert (op_num > 0); int stmt_num = op_num - 1; gimple *stmts = XALLOCAVEC (gimple, stmt_num); int op_index = op_num - 1; -- 2.11.4.GIT