Bug 61960 - internal compiler error: in gfc_conv_component_ref
Summary: internal compiler error: in gfc_conv_component_ref
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.8.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-30 10:00 UTC by Geert Jan Bex
Modified: 2015-09-29 17:24 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-08-02 00:00:00


Attachments
directory containing source to reproduce, and output of compiler (2.87 KB, application/x-gzip)
2014-07-30 10:00 UTC, Geert Jan Bex
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Geert Jan Bex 2014-07-30 10:00:42 UTC
Created attachment 33210 [details]
directory containing source to reproduce, and output of compiler

When compiling, the compiler crashes with the following error:
internal compiler error: in gfc_conv_component_ref, at fortran/trans-expr.c:1574
Compiler command & options:
gfortran -v -save-temps -O2 -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations  -g -Wall -Wextra -c data_func_mod.f90 refactored_func.f90

Detail and source code can be found in the file 'output.txt' that is included in the gzipped tar file.

The OS is:
Linux version 2.6.32-358.el6.x86_64 (mockbuild@x86-022.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Tue Jan 29 11:47:41 EST 2013

However, the crash can be reproduced with GCC 4.7.2 on the same system, and 4.8.2-19ubuntu1 on:
Linux version 3.13.0-32-generic (buildd@roseapple) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #57-Ubuntu SMP Tue Jul 15 03:51:12 UTC 2014

Best, -gjb-
Comment 1 Dominique d'Humieres 2014-08-02 11:31:16 UTC
Reduced test

module data_func_mod
    implicit none
    integer, parameter :: sp = 4
    type :: data_type
        real(kind=sp), pointer, dimension(:, :) :: data => null()
        integer :: nr_rows = 0, nr_cols = 0
    end type data_type

contains

    function get_row(this, i) result(row)
        implicit none
        type(data_type), intent(in) :: this
        integer, intent(in) :: i
        real(kind=sp), dimension(this%nr_cols) :: row
        row = this%data(:, i)
    end function get_row

    subroutine print_matrix(m)
        implicit none
        class(data_type), intent(in) :: m
        integer :: i
        character(len=20) :: fmt_str
            write (unit=6, fmt=fmt_str) get_row(m, 1)
    end subroutine print_matrix

end module data_func_mod

Before revision r182107 (2011-12-08) compiling the test gave the error

pr61960_red.f90:24.48:

            write (unit=6, fmt=fmt_str) get_row(m, 1)
                                                1
Error: Type mismatch in argument 'this' at (1); passed CLASS(data_type) to TYPE(data_type)

At revision r183001 (2012-01-09) the original and the reduced tests compile up to revision r183968 (2012-02-03). From revision r184278 (2012-02-15) up to trunk the compilation gives an ICE in trans-expr.c.
Comment 2 Bernd Edlinger 2015-02-22 19:39:25 UTC
Author: edlinger
Date: Sun Feb 22 19:38:53 2015
New Revision: 220899

URL: https://gcc.gnu.org/viewcvs?rev=220899&root=gcc&view=rev
Log:
2015-02-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR fortran/64980
        PR fortran/61960
        * trans-expr.c (gfc_apply_interface_mapping_to_expr): Remove mapping
        for component references to class objects.
        (gfc_conv_procedure_call): Compare the class by name.

testsuite:
2015-02-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR fortran/64980
        PR fortran/61960
        * gfortran.dg/pr61960.f90: New.
        * gfortran.dg/pr64230.f90: New.
        * gfortran.dg/pr64980.f03: New.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr61960.f90
    trunk/gcc/testsuite/gfortran.dg/pr64230.f90
    trunk/gcc/testsuite/gfortran.dg/pr64980.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Dominique d'Humieres 2015-02-27 21:42:44 UTC
Is not this PR fixed by revision r220899?
Comment 4 Dominique d'Humieres 2015-08-30 15:28:10 UTC
> Is not this PR fixed by revision r220899?

PING! Without answer I'll close this PR as FIXED.
Comment 5 Geert Jan Bex 2015-09-03 09:13:01 UTC
Dear,

Sorry, this is too long ago, I've lost the context of this.

I guess it is okay to consider the issue solved.

Thanks, best regards, -gjb-

On Sun, Aug 30, 2015 at 5:28 PM, dominiq at lps dot ens.fr <
gcc-bugzilla@gcc.gnu.org> wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61960
>
> --- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> > Is not this PR fixed by revision r220899?
>
> PING! Without answer I'll close this PR as FIXED.
>
> --
> You are receiving this mail because:
> You reported the bug.
>
Comment 6 Dominique d'Humieres 2015-09-29 17:24:16 UTC
> I guess it is okay to consider the issue solved.

So closing as FIXED.