public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49961] New: type bounded function can not return a pointer of a array
@ 2011-08-03 13:02 quaintchewster at gmail dot com
  2011-08-03 13:18 ` [Bug fortran/49961] " dominiq at lps dot ens.fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: quaintchewster at gmail dot com @ 2011-08-03 13:02 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: type bounded function can not return a pointer of a
                    array
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: quaintchewster@gmail.com


!------------------- code -------------------------


module aa
  type bb
   integer,pointer,dimension(:) :: cc
   integer,pointer :: dd
   contains
     procedure :: getcc
     procedure :: getdd
  end type

  contains
     function getcc(this)  result(cc)
        class(bb) :: this
        integer,pointer,dimension(:) :: cc
        cc => this%cc
     end function

     function getdd(this)  result(dd)
        class(bb) :: this
        integer,pointer :: dd
        dd => this%dd
     end function
end module

program main
  use aa
  implicit none
  type(bb) :: b1
  integer,pointer,dimension(:) :: p1
  integer,pointer :: p2

  allocate(b1%cc(10),b1%dd)
  b1%cc = 10
  b1%dd = 5
  p1 => b1%getcc()   ! Line 34, HERE !!
  write(*,*) 'p1 ',p1(1)
  p2 => b1%getdd()
  write(*,*) 'p2 ',p2
end



!------------------- code -------------------------


2 compile command line and info

$ gfortran -v  -save-temps test_point_arg02.f95
Driving: gfortran -v -save-temps test_point_arg02.f95 -lgfortran -lm
-shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.5 --enable-shared --enable-multiarch
--with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/x86_64-linux-gnu
--enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default
--with-plugin-ld=ld.gold --enable-objc-gc --disable-werror --with-arch-32=i686
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/f951 test_point_arg02.f95
-quiet -dumpbase test_point_arg02.f95 -mtune=generic -march=x86-64 -auxbase
test_point_arg02 -version -fintrinsic-modules-path
/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/finclude -o
test_point_arg02.s
GNU Fortran (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (x86_64-linux-gnu)
    compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (x86_64-linux-gnu)
    compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
test_point_arg02.f95: In function ‘MAIN__’:
test_point_arg02.f95:34:0: internal compiler error: in gfc_conv_variable, at
fortran/trans-expr.c:551
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions.


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

end of thread, other threads:[~2011-08-15  9:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-03 13:02 [Bug fortran/49961] New: type bounded function can not return a pointer of a array quaintchewster at gmail dot com
2011-08-03 13:18 ` [Bug fortran/49961] " dominiq at lps dot ens.fr
2011-08-03 15:21 ` burnus at gcc dot gnu.org
2011-08-04 17:25 ` [Bug fortran/49961] [OOP] type-bound " janus at gcc dot gnu.org
2011-08-04 17:46 ` janus at gcc dot gnu.org
2011-08-11  3:45 ` quaintchewster at gmail dot com
2011-08-15 10:41 ` janus 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).