public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug fortran/64555] New: Fail to compile array pointer to derived-type components @ 2015-01-10 15:34 thfanning at gmail dot com 2015-01-10 15:56 ` [Bug fortran/64555] " thfanning at gmail dot com ` (3 more replies) 0 siblings, 4 replies; 5+ messages in thread From: thfanning at gmail dot com @ 2015-01-10 15:34 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64555 Bug ID: 64555 Summary: Fail to compile array pointer to derived-type components Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: blocker Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: thfanning at gmail dot com When assigning an array pointer to a scalar component of an array of a derived type, compilation fails with undefined "span.n". Given the following code, test.f90: module mod_abc type a integer :: item end type type(a), pointer :: array(:) integer, pointer :: item(:) => NULL() contains subroutine init(n) integer :: n allocate(array(n)) item => array%item ! problem occurs here end subroutine end module program test use mod_abc integer, parameter :: n = 10 integer :: i print *, "Hello, World!" call init(n) do i = 1,n array(i)%item = i enddo do i = 1,n print "(i6,': ',i6)", i, item(i) enddo end program On an Intel architecture... gfortran -m32 test.f90: /var/folders/l9/qcd__g594cv5qn_nc1nwyvvrd6xjn9/T//ccmNxERg.s:209:non-relocatable subtraction expression, "_span.0" minus "L2$pb" /var/folders/l9/qcd__g594cv5qn_nc1nwyvvrd6xjn9/T//ccmNxERg.s:209:symbol: "_span.0" can't be undefined in a subtraction expression /var/folders/l9/qcd__g594cv5qn_nc1nwyvvrd6xjn9/T//ccmNxERg.s:93:non-relocatable subtraction expression, "_span.0" minus "L1$pb" /var/folders/l9/qcd__g594cv5qn_nc1nwyvvrd6xjn9/T//ccmNxERg.s:93:symbol: "_span.0" can't be undefined in a subtraction expression gfortran -m64 test.f90: Undefined symbols for architecture x86_64: "_span.0", referenced from: ___mod_abc_MOD_init in ccyXTbtG.o _MAIN__ in ccyXTbtG.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status On an embedded ARM architecture: gfortran test.f90: /tmp/cccNTntp.o: In function `__mod_abc_MOD_init': span.f90:(.text+0x1b4): undefined reference to `span.0' /tmp/cccNTntp.o: In function `MAIN__': span.f90:(.text+0x38c): undefined reference to `span.0' collect2: ld returned 1 exit status HOWEVER, if optimization is used on the ARM, then the code compiles correctly: gfortran -O test.f90 ./a.out Hello, World! 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/64555] Fail to compile array pointer to derived-type components 2015-01-10 15:34 [Bug fortran/64555] New: Fail to compile array pointer to derived-type components thfanning at gmail dot com @ 2015-01-10 15:56 ` thfanning at gmail dot com 2015-01-10 17:06 ` dominiq at lps dot ens.fr ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: thfanning at gmail dot com @ 2015-01-10 15:56 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64555 Thomas Fanning <thfanning at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|blocker |major ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/64555] Fail to compile array pointer to derived-type components 2015-01-10 15:34 [Bug fortran/64555] New: Fail to compile array pointer to derived-type components thfanning at gmail dot com 2015-01-10 15:56 ` [Bug fortran/64555] " thfanning at gmail dot com @ 2015-01-10 17:06 ` dominiq at lps dot ens.fr 2015-01-10 17:08 ` dominiq at lps dot ens.fr 2015-08-30 10:26 ` dominiq at lps dot ens.fr 3 siblings, 0 replies; 5+ messages in thread From: dominiq at lps dot ens.fr @ 2015-01-10 17:06 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64555 Dominique d'Humieres <dominiq at lps dot ens.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2015-01-10 Ever confirmed|0 |1 --- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- I think this is a duplicate of pr34640 and/or pr40737. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/64555] Fail to compile array pointer to derived-type components 2015-01-10 15:34 [Bug fortran/64555] New: Fail to compile array pointer to derived-type components thfanning at gmail dot com 2015-01-10 15:56 ` [Bug fortran/64555] " thfanning at gmail dot com 2015-01-10 17:06 ` dominiq at lps dot ens.fr @ 2015-01-10 17:08 ` dominiq at lps dot ens.fr 2015-08-30 10:26 ` dominiq at lps dot ens.fr 3 siblings, 0 replies; 5+ messages in thread From: dominiq at lps dot ens.fr @ 2015-01-10 17:08 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64555 Dominique d'Humieres <dominiq at lps dot ens.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code Known to fail| |4.8.5, 4.9.3, 5.0 Severity|major |normal --- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- Fortran PRs are 'normal' or below. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/64555] Fail to compile array pointer to derived-type components 2015-01-10 15:34 [Bug fortran/64555] New: Fail to compile array pointer to derived-type components thfanning at gmail dot com ` (2 preceding siblings ...) 2015-01-10 17:08 ` dominiq at lps dot ens.fr @ 2015-08-30 10:26 ` dominiq at lps dot ens.fr 3 siblings, 0 replies; 5+ messages in thread From: dominiq at lps dot ens.fr @ 2015-08-30 10:26 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64555 Dominique d'Humieres <dominiq at lps dot ens.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |DUPLICATE --- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- Dup. *** This bug has been marked as a duplicate of bug 40737 *** ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-30 10:26 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-01-10 15:34 [Bug fortran/64555] New: Fail to compile array pointer to derived-type components thfanning at gmail dot com 2015-01-10 15:56 ` [Bug fortran/64555] " thfanning at gmail dot com 2015-01-10 17:06 ` dominiq at lps dot ens.fr 2015-01-10 17:08 ` dominiq at lps dot ens.fr 2015-08-30 10:26 ` dominiq at lps dot ens.fr
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).