This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/69368] [6 Regression] spec2006 test case 416.gamess fails with the g++ 6.0 compiler starting with r232508
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 Feb 2016 19:30:17 +0000
- Subject: [Bug fortran/69368] [6 Regression] spec2006 test case 416.gamess fails with the g++ 6.0 compiler starting with r232508
- Auto-submitted: auto-generated
- References: <bug-69368-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69368
--- Comment #38 from rguenther at suse dot de <rguenther at suse dot de> ---
On February 9, 2016 5:28:07 PM GMT+01:00, "jakub at gcc dot gnu.org"
<gcc-bugzilla@gcc.gnu.org> wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69368
>
>--- Comment #36 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
>As Richard said, you can do similar (invalid too) stuff in C too, say:
>struct S { int a[10000]; } s;
>in one TU and
>struct S { int a[1]; } s;
>
>int
>foo (int x)
>{
> return s.a[x];
>}
>
>int
>bar (int x)
>{
> return s.a[1 + x] + s.a[0] + s.a[x];
>}
>
>GCC 5 would compile it to what the author might have meant, while GCC 6
>will
>optimize bar into s.a[0] * 3;
I think already GCC 4.8 would do that. New in GCC 6 is that DOM will now know
this trick and thus you get this after loop opts