public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/39006]  New: Wrong result for  array(:,ny:1:-1))  as actual argument (inverting order by negative strides)
@ 2009-01-28 17:13 burnus at gcc dot gnu dot org
  2009-01-28 17:31 ` [Bug fortran/39006] " pault at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-01-28 17:13 UTC (permalink / raw)
  To: gcc-bugs

Reported by Clive Page, http://gcc.gnu.org/ml/fortran/2009-01/msg00335.html

Fails with gfortran 4.1, 4.2, 4.3 and 4.4, but works with NAG f95, g95, ifort
(9.1, 11.0), openf95.

The proper result of the test program is:
------------------------------------------
 normal
   1   2   3   4
  10  20  30  40
 100 200 300 400
 y-inverted
 100 200 300 400    <<<<<<<  These lines
  10  20  30  40    <<<<<<<  are missing
   1   2   3   4    <<<<<<<  with gfortran
------------------------------------------

The program:

!-----------------------------------------
module testy_mod
implicit none
contains
subroutine mysub(text, array)
character(len=*), intent(in) :: text
integer, intent(in) :: array(:,:)
integer :: j
print *, text
do j = 1, ubound(array,2)
   print '(10000i4)', array(:,j)
end do
end subroutine mysub
end module testy_mod

program testy
use testy_mod
implicit none
integer, parameter :: nx = 4, ny = 3
integer :: array(nx,ny)
data array / 1,2,3,4, 10,20,30,40, 100,200,300,400 /
call mysub('normal', array)
call mysub('y-inverted', array(:,ny:1:-1))
end program


-- 
           Summary: Wrong result for  array(:,ny:1:-1))  as actual argument
                    (inverting order by negative strides)
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: critical
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 32834
             nThis:


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


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

* [Bug fortran/39006] Wrong result for  array(:,ny:1:-1))  as actual argument (inverting order by negative strides)
  2009-01-28 17:13 [Bug fortran/39006] New: Wrong result for array(:,ny:1:-1)) as actual argument (inverting order by negative strides) burnus at gcc dot gnu dot org
@ 2009-01-28 17:31 ` pault at gcc dot gnu dot org
  2009-01-28 21:49 ` pault at gcc dot gnu dot org
  2009-02-19  6:44 ` pault at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-01-28 17:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pault at gcc dot gnu dot org  2009-01-28 17:31 -------
This is the same as PR38852 and the fix for that one works for this too.

Paul

*** This bug has been marked as a duplicate of 38852 ***


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug fortran/39006] Wrong result for  array(:,ny:1:-1))  as actual argument (inverting order by negative strides)
  2009-01-28 17:13 [Bug fortran/39006] New: Wrong result for array(:,ny:1:-1)) as actual argument (inverting order by negative strides) burnus at gcc dot gnu dot org
  2009-01-28 17:31 ` [Bug fortran/39006] " pault at gcc dot gnu dot org
@ 2009-01-28 21:49 ` pault at gcc dot gnu dot org
  2009-02-19  6:44 ` pault at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-01-28 21:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pault at gcc dot gnu dot org  2009-01-28 21:49 -------
Subject: Bug 39006

Author: pault
Date: Wed Jan 28 21:48:53 2009
New Revision: 143743

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143743
Log:
2009-01-28  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/38852
        PR fortran/39006
        * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use the array
        descriptor ubound for UBOUND, when the array lbound == 1.

2009-01-28  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/38852
        PR fortran/39006
        * gfortran.dg/bound_6.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/bound_6.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-intrinsic.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/39006] Wrong result for  array(:,ny:1:-1))  as actual argument (inverting order by negative strides)
  2009-01-28 17:13 [Bug fortran/39006] New: Wrong result for array(:,ny:1:-1)) as actual argument (inverting order by negative strides) burnus at gcc dot gnu dot org
  2009-01-28 17:31 ` [Bug fortran/39006] " pault at gcc dot gnu dot org
  2009-01-28 21:49 ` pault at gcc dot gnu dot org
@ 2009-02-19  6:44 ` pault at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-02-19  6:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2009-02-19 06:43 -------
Subject: Bug 39006

Author: pault
Date: Thu Feb 19 06:43:15 2009
New Revision: 144286

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144286
Log:
2009-02-19  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/38852
        PR fortran/39006
        * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use the array
        descriptor ubound for UBOUND, when the array lbound == 1.

2009-02-19  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/38852
        PR fortran/39006
        * gfortran.dg/bound_6.f90: New test.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/bound_6.f90
Modified:
    branches/gcc-4_3-branch/gcc/fortran/ChangeLog
    branches/gcc-4_3-branch/gcc/fortran/trans-intrinsic.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2009-02-19  6:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-28 17:13 [Bug fortran/39006] New: Wrong result for array(:,ny:1:-1)) as actual argument (inverting order by negative strides) burnus at gcc dot gnu dot org
2009-01-28 17:31 ` [Bug fortran/39006] " pault at gcc dot gnu dot org
2009-01-28 21:49 ` pault at gcc dot gnu dot org
2009-02-19  6:44 ` pault at gcc dot gnu dot 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).