public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/61780] New: [4.8/4.9/4.10 Regression] Wrong code when shifting elements of a multidimensional array
@ 2014-07-11 16:38 dominiq at lps dot ens.fr
  2014-07-11 16:42 ` [Bug fortran/61780] " dominiq at lps dot ens.fr
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-07-11 16:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61780

            Bug ID: 61780
           Summary: [4.8/4.9/4.10 Regression] Wrong code when shifting
                    elements of a multidimensional array
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dominiq at lps dot ens.fr
                CC: pault at gcc dot gnu.org, tkoenig at gcc dot gnu.org

>From https://groups.google.com/forum/#!topic/comp.lang.fortran/mfS-BB2X-90, the
following code gives a wrong result at run time

program prgm3 
    implicit none 
    integer, parameter :: n = 10, k = 3 
    integer :: i, j 
    integer, dimension(n,n) :: y 
    integer :: res1(n), res2(n)

1   format(10i5) 

!initialize 
    do i=1,n 
        do j=1,n 
            y(i,j) = n*i + j 
        end do 
    end do 
    res2 = y(k,:) 

!shift right 
    y(k,4:n) = y(k,3:n-1) 
    y(k,3) = 0 
    res1 = y(k,:)
    y(k,:) = res2
    y(k,n:4:-1) = y(k,n-1:3:-1) 
    y(k,3) = 0 
    res2 = y(k,:) 
    print *, res1
    print *, res2
    if (any(res1 /= res2)) call abort () 

end program prgm3 

Revision r174295 (2011-05-26) is OK, r174338 (2011-05-27) is not, likely
r174302 (pr48955).


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

end of thread, other threads:[~2014-07-19 14:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-11 16:38 [Bug fortran/61780] New: [4.8/4.9/4.10 Regression] Wrong code when shifting elements of a multidimensional array dominiq at lps dot ens.fr
2014-07-11 16:42 ` [Bug fortran/61780] " dominiq at lps dot ens.fr
2014-07-12 11:43 ` mikael at gcc dot gnu.org
2014-07-12 12:39 ` pault at gcc dot gnu.org
2014-07-12 15:18 ` paul.richard.thomas at gmail dot com
2014-07-12 19:09 ` pault at gcc dot gnu.org
2014-07-13 12:52 ` mikael at gcc dot gnu.org
2014-07-14 10:42 ` [Bug fortran/61780] [4.8/4.9 " rguenth at gcc dot gnu.org
2014-07-14 13:15 ` paul.richard.thomas at gmail dot com
2014-07-19 13:50 ` pault at gcc dot gnu.org
2014-07-19 14:31 ` pault at gcc dot gnu.org
2014-07-19 14:32 ` 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).