[Bug ipa/83346] inliner crash with always inline and templates

andi-gcc at firstfloor dot org gcc-bugzilla@gcc.gnu.org
Sat Dec 9 21:39:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83346

--- Comment #1 from Andi Kleen <andi-gcc at firstfloor dot org> ---
This fixes it. Don't know why that node has no decl.

Will submit after a test cycle.

diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 7846e93d119..dcd8a3de1ac 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -2391,7 +2391,8 @@ ipa_inline (void)
         entry of cycles, possibly cloning that entry point and
         try to flatten itself turning it into a self-recursive
         function.  */
-      if (lookup_attribute ("flatten",
+      if (node->decl
+        && lookup_attribute ("flatten",
                            DECL_ATTRIBUTES (node->decl)) != NULL)
        {
          if (dump_file)


More information about the Gcc-bugs mailing list