This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Two internal compiler errors


Hi Janus,

I will open a PR for both.

Regards,

Arjen

2011/2/13 Janus Weil <janus@gcc.gnu.org>:
> Hi Arjen,
>
>> while experimenting with the object-oriented features of Fortran 2003
>> I ran into a few ICEs.
>
> thanks for the test drive :)
>
>
>> The compiler stops with a message that there was a segmentation fault,
>> the reported line is line 56.
>> (No syntax errors or other messages of any kind are reported)
>
> Ok, I can confirm this with the current trunk and the following reduction:
>
> program test_objects
>
> ? implicit none
>
> ? type, abstract :: shape
> ? end type
>
> ? type, extends(shape) :: rectangle
> ? ? ? real :: width, height
> ? end type
>
> ? class(shape), dimension(2) :: object
>
> ? object(1) = rectangle( 1.0, 2.0 )
>
> end program test_objects
>
>
> There are at least two problems with this:
> 1) Your "object" is missing one of the attributes POINTER or
> ALLOCATABLE. Declaring "plain" class objects like this is forbidden.
> 2) gfortran currently does not support dimensionful class variables.
> This of course is not a flaw of your program, but of gfortran ;)
>
> However, it seems the respective error messages are being swallowed by
> the ICE (which is caused by the last line). Could you open a PR for
> this? I will take care of fixing it ...
>
> Cheers,
> Janus
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]