public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/40187]  New: c_f_pointer with stride in SHAPE
@ 2009-05-18 17:58 tkoenig at gcc dot gnu dot org
  2009-05-18 21:20 ` [Bug libfortran/40187] " burnus at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2009-05-18 17:58 UTC (permalink / raw)
  To: gcc-bugs

Using a SHAPE with stride doesn't work with c_f_pointer doesn't work
(modified test case from the testsuite):

$ diff -u c_f_pointer_shape_tests_4.f03
~/gcc/trunk/gcc/testsuite/gfortran.dg/c_f_pointer_shape_tests_2.f03
--- c_f_pointer_shape_tests_4.f03       2009-05-18 19:55:36.000000000 +0200
+++
/home/ig25/gcc/trunk/gcc/testsuite/gfortran.dg/c_f_pointer_shape_tests_2.f03   
    2007-11-17 17:27:32.000000000 +0100
@@ -29,13 +29,12 @@
     integer(c_int), value :: num_rows
     integer(c_int), value :: num_cols
     integer, dimension(:,:), pointer :: myArrayPtr
-    integer(c_long_long), dimension(3) :: shape
+    integer(c_long_long), dimension(2) :: shape
     integer :: i,j

     shape(1) = num_rows
-    shape(2) = -3;
-    shape(3) = num_cols
-    call c_f_pointer(cPtr, myArrayPtr, shape(1:3:2))
+    shape(2) = num_cols
+    call c_f_pointer(cPtr, myArrayPtr, shape)
     do j = 1, num_cols
        do i = 1, num_rows
           if(myArrayPtr(i,j) /= ((j-1)*num_rows)+(i-1)) call abort ()
$ gfortran
~/gcc/trunk/gcc/testsuite/gfortran.dg/c_f_pointer_shape_tests_2_driver.c
c_f_pointer_shape_tests_4.f03
$ ./a.out
Aborted


-- 
           Summary: c_f_pointer with stride in SHAPE
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


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


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

end of thread, other threads:[~2009-07-27  9:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-18 17:58 [Bug libfortran/40187] New: c_f_pointer with stride in SHAPE tkoenig at gcc dot gnu dot org
2009-05-18 21:20 ` [Bug libfortran/40187] " burnus at gcc dot gnu dot org
2009-05-19  5:07 ` pault at gcc dot gnu dot org
2009-05-19 17:14 ` tkoenig at gcc dot gnu dot org
2009-05-19 17:18 ` tkoenig at gcc dot gnu dot org
2009-05-19 17:18 ` tkoenig at gcc dot gnu dot org
2009-05-27  5:27 ` tkoenig at gcc dot gnu dot org
2009-05-30 13:17 ` tkoenig at gcc dot gnu dot org
2009-06-07 14:24 ` tkoenig at gcc dot gnu dot org
2009-06-07 14:37 ` burnus at gcc dot gnu dot org
2009-07-27  9:11 ` tkoenig 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).