[C PATCH] Reject weak nested functions (PR c/89340)
Joseph Myers
joseph@codesourcery.com
Fri Feb 15 00:53:00 GMT 2019
On Fri, 15 Feb 2019, Jakub Jelinek wrote:
> Hi!
>
> We ICE on the following testcase, because C nested functions are turned into
> !TREE_PUBLIC ones very soon, and the IPA code asserts that DECL_WEAK functions
> are either TREE_PUBLIC or DECL_EXTERNAL.
> As we reject static __attribute__((weak)) void foo () {}, I think we should
> reject weak nested functions, they don't make much sense either, they are
> TU local too.
>
> The following patch fixes that. The other effect of the patch is that leaf
> attribute is warned and ignored on the nested function, but similarly, we
> ignore and warn for leaf attribute on other TU local functions, we see the
> nested function body and can analyze everything in it.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
OK.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc-patches
mailing list