This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Discard unreachable nested functions at -O0


On Mon, May 31, 2010 at 12:26 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> in Ada the front-end generates a lot of nested functions for generic packages
> or composite types and we want them to be discarded if unreachable even at -O0
> to speed things up and save memory.
>
> Some years ago I submitted a patch to that effect:
> ?http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01201.html
> but it was rejected by RTH on technical grounds (we use it internally though).
>
> I'm submitting a revised version, which is trivial since the compiler now
> works in unit-at-a-time mode. ?And it's worth noting that this is actually
> supposed to be already implemented, see cgraph_decide_is_function_needed:
>
> ? ? When not optimizing, also output the static functions. (see
> ? ? PR24561), but don't do so for always_inline functions, functions
> ? ? declared inline and nested functions. ?These was optimized out
> ? ? in the original implementation and it is unclear whether we want
> ? ? to change the behavior here. ?*/
>
> Tested on x86_64-suse-linux, OK for mainline?

Ok.

Thanks,
Richard.

>
> 2010-05-31 ?Eric Botcazou ?<ebotcazou@adacore.com>
>
> ? ? ? ?* cgraphunit.c (cgraph_decide_is_function_needed): Really return false
> ? ? ? ?for nested functions in non-optimized compilation.
>
>
> 2010-05-31 ?Eric Botcazou ?<ebotcazou@adacore.com>
>
> ? ? ? ?* gcc.dg/nested-func-7.c: New test.
> ? ? ? ?* gnat.dg/frame_overflow.adb: Adjust directives.
>
>
> --
> Eric Botcazou
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]