Initial shrink-wrapping patch

Bernd Schmidt bernds@codesourcery.com
Thu Oct 6 01:43:00 GMT 2011


On 10/06/11 01:04, Ian Lance Taylor wrote:
> On Wed, Oct 5, 2011 at 10:17 AM, Bernd Schmidt <bernds@codesourcery.com> wrote:
>>
>> I've committed the following after a x86_64-linux bootstrap.
> 
> This patch appears to have broken the Go bootstrap when compiling a C
> file in libgo.  Here is a reduced test case:
> 
> static struct
> {
>   int n;
>   unsigned int m;
>   _Bool f;
> } g;
> 
> _Bool
> f (int s)
> {
>   unsigned int b, m;
> 
>   if (!g.f)
>     return 0;
>   b = 1 << s;
>   while (1)
>     {
>       m = g.m;
>       if (m & b)
>         break;
>       if (__sync_bool_compare_and_swap (&g.m, m, m|b))
>         {
>           if (m == 0)
>             f2 (&g.n);
>           break;
>         }
>     }
>   return 1;
> }
> 
> Compiling this file with -O2 -fsplit-stack causes an ICE:
> 
> foo.c:29:1: internal compiler error: in maybe_record_trace_start, at
> dwarf2cfi.c:2243
> 
> Compiling the file with -O2 -fsplit-stack -fno-shrink-wrap works.

This appears to be because the split prologue contains a jump, which
means the find_many_sub_blocks call reorders the block numbers, and our
indices into bb_flags are off.

I'm testing the following patch, but it won't finish today - feel free
to test and check it in, or to just disable shrink-wrapping with split
prologues.


Bernd
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ucsr.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111006/824ad5f8/attachment.ksh>


More information about the Gcc-patches mailing list