public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gfortran problems with equivalence statement in module
@ 2019-01-27 23:00 airplanemath via cygwin
  2019-01-28  6:58 ` Arjen Markus
  0 siblings, 1 reply; 2+ messages in thread
From: airplanemath via cygwin @ 2019-01-27 23:00 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Problematic fortran file. --]
[-- Type: text/plain, Size: 236 bytes --]

module test
  integer, parameter :: rb = kind(1.0)              
  real(kind=rb) :: ka(5,13,10)   , absa(65,10)
  real(kind=rb) :: kb(5,13:59,10), absb(235,10)
  equivalence (ka(1,1,1),absa(1,1)), (kb(1,13,1),absb(1,1))
end module test

[-- Attachment #2: Type: text/plain, Size: 967 bytes --]

Compiling the attached fortran code with "gfortran -c test_compile.f90"
fails, citing an internal compiler error due to a segmentation fault.
Downgrading gcc-fortran to 7.3.0-3 or using the Mingw-w64 7.4.0-0
gfortran allows the compilation to complete and produce a .o file.
Running as "${host}-gfortran -c -wrapper gdb,--args test_compile.f90"
seems to indicate that the Mingw-w64 compiler does not have the line
that causes the problem in the cygwin-native compiler:

attributes = gfc_add_attributes_to_decl (com->head->attr, NULL_TREE);

where *com is initialized to zeros (so that com->head is NULL), and
there does not seem to be any place between the creation of *com and
the call above that would set com->head to something other than NULL.

I seem to be missing something here, but I have no idea what that might
be.  Can someone point out to me what it is I've missed?

Thanks for any help you may be able to give, and for providing cygwin
all these years.


[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: gfortran problems with equivalence statement in module
  2019-01-27 23:00 gfortran problems with equivalence statement in module airplanemath via cygwin
@ 2019-01-28  6:58 ` Arjen Markus
  0 siblings, 0 replies; 2+ messages in thread
From: Arjen Markus @ 2019-01-28  6:58 UTC (permalink / raw)
  To: airplanemath, Andrey Repin

out of curiosity I experimented a bit with this source code. It can be
simplified to:

module test
  integer, parameter :: rb = kind(1.0)
  real(kind=rb) :: ka(5,13,10)   , absa(65,10)
  equivalence (ka(1,1,1),absa(1,1))
end module test

If I make it a program, rather than a module, the compiler happily
produces a .o file. So it is not due to the non-one starting index in
the array kb

Regards,

Arjen

Op ma 28 jan. 2019 om 00:00 schreef airplanemath via cygwin <cygwin@cygwin.com>:
>
> Compiling the attached fortran code with "gfortran -c test_compile.f90"
> fails, citing an internal compiler error due to a segmentation fault.
> Downgrading gcc-fortran to 7.3.0-3 or using the Mingw-w64 7.4.0-0
> gfortran allows the compilation to complete and produce a .o file.
> Running as "${host}-gfortran -c -wrapper gdb,--args test_compile.f90"
> seems to indicate that the Mingw-w64 compiler does not have the line
> that causes the problem in the cygwin-native compiler:
>
> attributes = gfc_add_attributes_to_decl (com->head->attr, NULL_TREE);
>
> where *com is initialized to zeros (so that com->head is NULL), and
> there does not seem to be any place between the creation of *com and
> the call above that would set com->head to something other than NULL.
>
> I seem to be missing something here, but I have no idea what that might
> be.  Can someone point out to me what it is I've missed?
>
> Thanks for any help you may be able to give, and for providing cygwin
> all these years.
>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2019-01-28  6:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-27 23:00 gfortran problems with equivalence statement in module airplanemath via cygwin
2019-01-28  6:58 ` Arjen Markus

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).