From eeda041bff733052325d27b6607665fd005ec674 Mon Sep 17 00:00:00 2001 From: ienkovich Date: Thu, 3 Dec 2015 10:35:41 +0000 Subject: [PATCH] gcc/ * cfgexpand.c (expand_gimple_stmt_1): Return statement with DECL as return value is allowed to have NULL bounds. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231224 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/cfgexpand.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 35554453267..c576908d996 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-12-03 Ilya Enkovich + + * cfgexpand.c (expand_gimple_stmt_1): Return statement with + DECL as return value is allowed to have NULL bounds. + 2015-12-03 Tom de Vries * graphite-isl-ast-to-gimple.c (binary_op_to_tree) diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 1990e107db6..2c3b23d6244 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -3534,6 +3534,12 @@ expand_gimple_stmt_1 (gimple *stmt) { tree result = DECL_RESULT (current_function_decl); + /* Mark we have return statement with missing bounds. */ + if (!bnd + && chkp_function_instrumented_p (cfun->decl) + && !DECL_P (op0)) + bnd = error_mark_node; + /* If we are not returning the current function's RESULT_DECL, build an assignment to it. */ if (op0 != result) @@ -3550,9 +3556,6 @@ expand_gimple_stmt_1 (gimple *stmt) op0 = build2 (MODIFY_EXPR, TREE_TYPE (result), result, op0); } - /* Mark we have return statement with missing bounds. */ - if (!bnd && chkp_function_instrumented_p (cfun->decl)) - bnd = error_mark_node; } if (!op0) -- 2.11.4.GIT