public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/48955] New: [4.6/4.7 Regression] Wrong result for array assignment due to missing temporary
@ 2011-05-10 20:53 burnus at gcc dot gnu.org
  2011-05-10 21:28 ` [Bug fortran/48955] " burnus at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-05-10 20:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48955

           Summary: [4.6/4.7 Regression] Wrong result for array assignment
                    due to missing temporary
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: critical
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: pault@gcc.gnu.org, tkoenig@gcc.gnu.org


As reported on IRC.

The following program should print:

-10.0000 -20.0000 -20.0000 -10.0000  10.0000  20.0000  20.0000  10.0000 
-10.0000 -20.0000 -20.0000 -10.0000  10.0000  20.0000  20.0000  10.0000 


It does so with gfortran 4.3.4, 4.4.0, 4.5.3, ifort, NAG. However, using
gfortran 4.6.0, 4.7.0 (and for that matter 4.1.2) the first line is wrong:

-10.0000 -20.0000 -25.0000 -17.5000   6.2500  18.1250  24.0625  10.0000
-10.0000 -20.0000 -20.0000 -10.0000  10.0000  20.0000  20.0000  10.0000


program ala
   implicit none

   integer, parameter  :: n = 8
   real, dimension(n) :: v0, v1

   v0 = [-10.0, -10., -10., -10., 10., 10., 10., 10.]
   v1 = v0

   v1(2:n-1) = 0.5*(v1(1:n-2) + v1(3:n) + 2.0*v1(2:n-1))
   write(*,'(8(F8.4,1X))') v1
   v1 = v0
   v1(2:n-1) = 0.5*(v0(1:n-2) + v0(3:n) + 2.0*v0(2:n-1))
   write(*,'(8(F8.4,1X))') v1
end program ala


First regression hunting shows:
  Works: 2010-07-16-r162255
  Fails: 2010-08-28-r163612


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-05-26 21:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-10 20:53 [Bug fortran/48955] New: [4.6/4.7 Regression] Wrong result for array assignment due to missing temporary burnus at gcc dot gnu.org
2011-05-10 21:28 ` [Bug fortran/48955] " burnus at gcc dot gnu.org
2011-05-11  9:30 ` burnus at gcc dot gnu.org
2011-05-11  9:36 ` pault at gcc dot gnu.org
2011-05-11 10:01 ` jakub at gcc dot gnu.org
2011-05-11 19:28 ` tkoenig at gcc dot gnu.org
2011-05-11 20:17 ` pault at gcc dot gnu.org
2011-05-16  7:44 ` burnus at gcc dot gnu.org
2011-05-16 13:17 ` paul.richard.thomas at gmail dot com
2011-05-16 18:42 ` tkoenig at netcologne dot de
2011-05-21 17:10 ` tkoenig at gcc dot gnu.org
2011-05-22 18:51 ` pault at gcc dot gnu.org
2011-05-23 20:18 ` tkoenig at gcc dot gnu.org
2011-05-24 10:33 ` paul.richard.thomas at gmail dot com
2011-05-26 18:22 ` pault at gcc dot gnu.org
2011-05-26 20:57 ` pault at gcc dot gnu.org
2011-05-26 21:26 ` pault at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).