From 2b85591bb8833f7a334f1faef5e4f29ece735bc2 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 17 Mar 2003 18:16:55 -0500 Subject: [PATCH] * decl.c (finish_function): Don't skip a block. From-SVN: r64508 --- gcc/cp/ChangeLog | 2 ++ gcc/cp/decl.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 28883b2b91e1..888fcb988a23 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 2003-03-17 Jason Merrill + * decl.c (finish_function): Don't skip a block. + PR c++/9993 * decl.c (finish_function): Only allow the NRVO to use variables declared at function scope. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 7ba863d4347e..82ea2279ab24 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -14319,8 +14319,7 @@ finish_function (flags) the function so we know that their lifetime always ends with a return; see g++.dg/opt/nrv6.C. We could be more flexible if we were to do this optimization in tree-ssa. */ - /* Skip the artificial function body block. */ - && (outer = BLOCK_SUBBLOCKS (BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl))), + && (outer = BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl)), chain_member (r, BLOCK_VARS (outer)))) { -- 2.47.2