public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/46896] New: Wrong code with transpose(a) passed to subroutine
@ 2010-12-11 20:33 jvdelisle at gcc dot gnu.org
  2010-12-11 23:52 ` [Bug fortran/46896] [4.2/4.3/4.4/4.5/4/6 Regression] " hjl.tools at gmail dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2010-12-11 20:33 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Wrong code with transpose(a) passed to subroutine
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: major
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jvdelisle@gcc.gnu.org


This test case is from comment 12 of pr46842 and is a new bug.

integer :: a(2,2)
a = reshape([1,2,3,4], [2,2])
call sub(transpose(a))
contains
 subroutine sub(x)
   integer :: x(:,:)
   a(1,:) = 88
   a(2,:) = x(:,1)
   if (any (a(:,1) /= [88, 1]).or.any (a(:,2) /= [88, 3])) then
     print *, a
     call abort()
   end if
   print *, a
 end subroutine sub
end

Gives:

$ ./a.out 
          88          88          88          88

Should give:

$ ./a.out 
          88           1          88           3

This is a serious bug and should get some priority.


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

end of thread, other threads:[~2011-03-13 14:16 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-11 20:33 [Bug fortran/46896] New: Wrong code with transpose(a) passed to subroutine jvdelisle at gcc dot gnu.org
2010-12-11 23:52 ` [Bug fortran/46896] [4.2/4.3/4.4/4.5/4/6 Regression] " hjl.tools at gmail dot com
2010-12-11 23:52 ` hjl.tools at gmail dot com
2010-12-12  0:39 ` jvdelisle at gcc dot gnu.org
2010-12-12  9:02 ` [Bug fortran/46896] [4.2/4.3/4.4/4.5/4.6 " burnus at gcc dot gnu.org
2010-12-12 14:58 ` mikael at gcc dot gnu.org
2010-12-12 15:04 ` mikael at gcc dot gnu.org
2010-12-12 16:38 ` dominiq at lps dot ens.fr
2010-12-12 20:48 ` dominiq at lps dot ens.fr
2010-12-13 12:04 ` pault at gcc dot gnu.org
2010-12-13 12:07 ` pault at gcc dot gnu.org
2010-12-13 21:25 ` mikael at gcc dot gnu.org
2010-12-14  5:35 ` pault at gcc dot gnu.org
2010-12-16 14:43 ` [Bug fortran/46896] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu.org
2010-12-16 15:36 ` jakub at gcc dot gnu.org
2011-01-08 19:44 ` pault at gcc dot gnu.org
2011-02-14  9:29 ` burnus at gcc dot gnu.org
2011-02-14 13:51 ` paul.richard.thomas at gmail dot com
2011-03-13 14:16 ` 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).