From 1a33633742ab03c950358ac987ff660c99620dcb Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 27 Nov 2014 21:15:16 +0000 Subject: [PATCH] * dwarf2out.c (set_block_origin_self): Skip nested functions. From-SVN: r218133 --- gcc/ChangeLog | 4 ++++ gcc/dwarf2out.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 05547424d8d..4b3248fb526 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2014-11-27 Eric Botcazou + + * dwarf2out.c (set_block_origin_self): Skip nested functions. + 2014-11-27 H.J. Lu PR target/63833 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 25f0e7d3e26..b7f93f080fc 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -17940,8 +17940,11 @@ set_block_origin_self (tree stmt) for (local_decl = BLOCK_VARS (stmt); local_decl != NULL_TREE; local_decl = DECL_CHAIN (local_decl)) - if (! DECL_EXTERNAL (local_decl)) - set_decl_origin_self (local_decl); /* Potential recursion. */ + /* Do not recurse on nested functions since the inlining status + of parent and child can be different as per the DWARF spec. */ + if (TREE_CODE (local_decl) != FUNCTION_DECL + && !DECL_EXTERNAL (local_decl)) + set_decl_origin_self (local_decl); } { -- 2.30.2