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 jos...@codesourcery.com