This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc-4.8 + tree-loop-distribute-patterns breaks glibc-2.18
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: libc-alpha at sourceware dot org, gcc at gcc dot gnu dot org
- Date: Tue, 21 May 2013 10:34:35 +0200
- Subject: Re: gcc-4.8 + tree-loop-distribute-patterns breaks glibc-2.18
- References: <519A19D4 dot 6000001 at linux dot vnet dot ibm dot com> <20130520142848 dot GA3715 at winnix>
On Mon, May 20, 2013 at 4:28 PM, Winfried Magerl
<winfried.magerl@t-online.de> wrote:
> Hi,
>
> On Mon, May 20, 2013 at 09:40:52AM -0300, Adhemerval Zanella wrote:
>> Hi,
>>
>> Thanks for reporting it, I saw it too when building glibc with gcc-trunk.
>> Carlos O'Donell already reported it could be an issue to glibc at
>> http://sourceware.org/ml/libc-alpha/2013-02/msg00299.html and I also noted
>> it causes PTL issues too at http://sourceware.org/ml/libc-alpha/2013-04/msg00124.html
>> I have proposed a patch http://sourceware.org/ml/libc-alpha/2013-04/msg00196.html
>> so configure can check if compiler transform loops into libc functions calls, but
>> Andreas Jaeger and Roland McGrath didn't approve the approach.
>>
>> Although, the problem persist and I think we need to figure out how to proceed
>> before 2.18 release. Based on the loader memset recursion call you observe I do
>> suggest to use my approach and add '-fno-tree-loop-distribute-patterns' on
>> rtld-memset.os object.
>>
>> Any comments?
>
> tree-loop-distribute-patterns is enabled on gcc-4.7.3 with -O3:
>
> # /usr/gcc47/bin/gcc --version
> gcc (GCC) 4.7.3
> [....]
> # /usr/gcc47/bin/gcc -c -Q -O3 --help=optimizers | fgrep tree-loop-distribute-patterns
> -ftree-loop-distribute-patterns [enabled]
>
> And it looks like it's the default for a long time:
>
> # fgrep OPT_ftree_loop_distribute_patterns gcc-*/gcc/opts.c
> gcc-4.6.3/gcc/opts.c: { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
> gcc-4.7.0/gcc/opts.c: { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
> gcc-4.7.1/gcc/opts.c: { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
> gcc-4.7.2/gcc/opts.c: { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
> gcc-4.7.3/gcc/opts.c: { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
> gcc-4.8.0/gcc/opts.c: { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
>
> I wonder what's the difference between gcc-4.7.3 and gcc-4.8.x for
> 'tree-loop-distribute-patterns' ........
It's better in recognizing patterns that look like memset/memcpy.
Don't use it if you build TUs which contain memset/memcpy implementations.
Richard.
> regards
>
> winfried
>