* dwarf2out.c (set_block_origin_self): Skip nested functions.
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 27 Nov 2014 21:15:16 +0000 (21:15 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 27 Nov 2014 21:15:16 +0000 (21:15 +0000)
From-SVN: r218133

gcc/ChangeLog
gcc/dwarf2out.c

index 0554742..4b3248f 100644 (file)
@@ -1,3 +1,7 @@
+2014-11-27  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * dwarf2out.c (set_block_origin_self): Skip nested functions.
+
 2014-11-27  H.J. Lu  <hongjiu.lu@intel.com>
 
         PR target/63833
index 25f0e7d..b7f93f0 100644 (file)
@@ -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);
       }
 
       {