]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* auto-profile.c (string_table::get_index_by_decl)
authoramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Dec 2018 06:54:02 +0000 (06:54 +0000)
committeramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Dec 2018 06:54:02 +0000 (06:54 +0000)
(function_instance::get_function_instance_by_decl): Avoid infinite
recursion by using DECL_FROM_INLINE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266942 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/auto-profile.c

index 3711cf8ed9ab204e962699943811e031d385dbb8..6ac767e78175f40a6ece457c910b2bb1b899cd29 100644 (file)
@@ -1,3 +1,9 @@
+2018-12-10  Bin Cheng  <bin.cheng@linux.alibaba.com>
+
+       * auto-profile.c (string_table::get_index_by_decl)
+       (function_instance::get_function_instance_by_decl): Avoid infinite
+       recursion by using DECL_FROM_INLINE.
+
 2018-12-09  John David Anglin  <danglin@gcc.gnu.org>
 
        * config.gcc (hppa*-*-linux*): Add pa/t-pa to tmake_file.  Define
index f7ba32c30ac227cfb99c573cfe423c79f9fdb692..9316f4c477b97c18ea49eea66ea863f567e09d0b 100644 (file)
@@ -470,7 +470,7 @@ string_table::get_index_by_decl (tree decl) const
   ret = get_index (lang_hooks.dwarf_name (decl, 0));
   if (ret != -1)
     return ret;
-  if (DECL_ABSTRACT_ORIGIN (decl) && DECL_ABSTRACT_ORIGIN (decl) != decl)
+  if (DECL_FROM_INLINE (decl))
     return get_index_by_decl (DECL_ABSTRACT_ORIGIN (decl));
 
   return -1;
@@ -537,7 +537,7 @@ function_instance::get_function_instance_by_decl (unsigned lineno,
       if (ret != callsites.end ())
         return ret->second;
     }
-  if (DECL_ABSTRACT_ORIGIN (decl))
+  if (DECL_FROM_INLINE (decl))
     return get_function_instance_by_decl (lineno, DECL_ABSTRACT_ORIGIN (decl));
 
   return NULL;