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

            Bug ID: 89328
           Summary: static chain made mandatory
           Product: gcc
           Version: 7.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpoulhies at kalray dot eu
  Target Milestone: ---

Since r217769, a target without support for static chain will not work.

Previous this change, the message
```
nested functions not supported on this target
```

was displayed only when trying to build something using nested functions.
After this patch, the error is raised for all inputs. I guess because the
following test has been removed:

```
 rtx
-default_static_chain (const_tree fndecl, bool incoming_p)
+default_static_chain (const_tree ARG_UNUSED (fndecl_or_type), bool incoming_p)
 {
-  if (!DECL_STATIC_CHAIN (fndecl))
-    return NULL;
-
   if (incoming_p)
     {
```

I guess this was not spotted as it looks like all targets in gcc tree have
static chain support.
This has been a problem while updating a private port from gcc 4.9 to gcc 7. I
could not verify the issue is still in trunk but a quick look at the code let
me think it still is.

Reply via email to