This is the mail archive of the
mailing list for the GCC project.
Re: Patch RFC: disable block partitioning with split stack
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Ian Lance Taylor <iant at golang dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "gofrontend-dev at googlegroups dot com" <gofrontend-dev at googlegroups dot com>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Fri, 9 Jun 2017 12:16:38 +0200
- Subject: Re: Patch RFC: disable block partitioning with split stack
- Authentication-results: sourceware.org; auth=none
- References: <CAOyqgcXZgv9a5b+ynC4nT_5S4bFfQQwdkg0OXpsrDeXgeRgY+Q@mail.gmail.com>
> This recent patch
> https://gcc.gnu.org/ml/gcc-patches/2017-06/msg00518.html turned on
> block partitioning even when profiling is not enabled. This can break
I am heading towards enabling block partitioning by default (because we now
have infrastructure to identify likely cold BBs), but I must admit I did
not notice I made it happen by that patch. reorder_blocks_and_partition
is not enabled in opts.c but I see it is hidden within
common/config/i386/i386-common.c that I did not know even existed.
> code compiled with -fsplit-stack, if the cold partition calls a
> function that is not compiled with -fsplit-stack (such as a C library
> function). The problem is that when the linker sees a split-stack
> function call a non-split-stack function, it adjusts the function
> header to request more stack space. This doesn't work if the call is
> in the cold partition, as the linker doesn't know how to find the
> header to adjust. You can see this by trying to build the Go library
> using the gold linker with this patch.
If code does not work, I wonder why we let user to overwrite the default
by hand? In other cases we drop the flag with inform message.
Also bb-reorder knows how to prevent landing pads to go to different sections,
so perhaps same machinery can be used to prevent splitting blocks having
calls that needs linker adjustments?
But if fixing this is involved, I am fine with how it is done in your patch.