cfgexpand.c (expand_gimple_stmt_1): Return statement with DECL as return value is...
authorIlya Enkovich <enkovich.gnu@gmail.com>
Thu, 3 Dec 2015 10:35:41 +0000 (10:35 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Thu, 3 Dec 2015 10:35:41 +0000 (10:35 +0000)
gcc/

* cfgexpand.c (expand_gimple_stmt_1): Return statement with
DECL as return value is allowed to have NULL bounds.

From-SVN: r231224

gcc/ChangeLog
gcc/cfgexpand.c

index 35554453267b9f088be0933753dbc92e62baa3be..c576908d996c771c6dbcdcc8b637762a9425d52f 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-03  Ilya Enkovich  <enkovich.gnu@gmail.com>
+
+       * 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  <tom@codesourcery.com>
 
        * graphite-isl-ast-to-gimple.c (binary_op_to_tree)
index 1990e107db60ad80ac26c824e3f24bf777275037..2c3b23d62447fc253ae912b8733dc7d4356f429d 100644 (file)
@@ -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)