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: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 22 Feb 2016 10:03:26 +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 #66 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #65)
> > There is obviously no "rationale". Fact is that we don't exploit the
> > undefinedness explicitely but just as a side-effect of how CSE works in
> > DOM now. This means we don't propagate '1' as the only valid value of I
> > but just CSE the last three loads to the first as we know they are the
> > same (without knowing the actual value).
>
> How can K(1) and K(2*1) be the same without using undefinedness explicitely?
They can't, but why does that matter for undefined behavior?
The CSE code in DOM doesn't try to analyze the array indices at all, it is
enough for it to prove that in valid program they must be all same.
Whether the compiler could with additional efforts prove they are different or
not (it can't e.g. without LTO and without seeing caller that passes two
different variables).