Bug 71580 - Internal compiler error associated with type bound defined assignment
Summary: Internal compiler error associated with type bound defined assignment
Status: RESOLVED DUPLICATE of bug 70864
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-18 21:41 UTC by Ian Harvey
Modified: 2016-06-21 23:01 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-06-20 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Harvey 2016-06-18 21:41:08 UTC
With trunk r237470 the following results in an internal compiler error (sym->backend_decl is null at trans_decl.c:1420).

MODULE MySharedPointer
  IMPLICIT NONE
  PRIVATE
  
  PUBLIC :: SharedPointer
  
  TYPE, PRIVATE :: shared_pointer_impl
  CONTAINS
    PROCEDURE, PRIVATE :: assign => ptr_impl_assign
    GENERIC :: ASSIGNMENT(=) => assign
  END TYPE shared_pointer_impl
  
  TYPE :: SharedPointer
    PRIVATE
    TYPE(shared_pointer_impl) :: impl = shared_pointer_impl()
  END TYPE SharedPointer
CONTAINS
  SUBROUTINE ptr_impl_assign(lhs, rhs)
    CLASS(shared_pointer_impl), INTENT(OUT) :: lhs
    TYPE(shared_pointer_impl), INTENT(IN) :: rhs
  END SUBROUTINE ptr_impl_assign
  
  SUBROUTINE evil01_worker(x)
    TYPE(SharedPointer) :: x
    x = make_ptr()
  END SUBROUTINE evil01_worker
  
  FUNCTION make_ptr() RESULT(ptr)
    TYPE(SharedPointer) :: ptr
  END FUNCTION make_ptr
END MODULE MySharedPointer



$ gfortran -v PolyScalarSharedPointerExample.f90
Driving: gfortran -v PolyScalarSharedPointerExample.f90 -l gfortran -l m -shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/MEGMS2/ian/usr/gcc-7.0.0/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: .././src/configure --prefix=/home/MEGMS2/ian/usr/gcc-7.0.0 --enable-languages=c,c++,fortran --enable-libgomp --enable-checking=release
Thread model: posix
gcc version 7.0.0 20160615 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /home/MEGMS2/ian/usr/gcc-7.0.0/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/f951 PolyScalarSharedPointerExample.f90 -quiet -dumpbase PolyScalarSharedPointerExample.f90 -mtune=generic -march=x86-64 -auxbase PolyScalarSharedPointerExample -version -fintrinsic-modules-path /home/MEGMS2/ian/usr/gcc-7.0.0/lib/gcc/x86_64-pc-linux-gnu/7.0.0/finclude -o /tmp/ccdBc06e.s
GNU Fortran (GCC) version 7.0.0 20160615 (experimental) (x86_64-pc-linux-gnu)
        compiled by GNU C version 7.0.0 20160615 (experimental), GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.2, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran2008 (GCC) version 7.0.0 20160615 (experimental) (x86_64-pc-linux-gnu)
        compiled by GNU C version 7.0.0 20160615 (experimental), GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.2, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
PolyScalarSharedPointerExample.f90:30:0:

   END FUNCTION make_ptr

internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1420
0x6a1408 gfc_get_symbol_decl(gfc_symbol*)
        ../.././src/gcc/fortran/trans-decl.c:1420
0x6a370f generate_local_decl
        ../.././src/gcc/fortran/trans-decl.c:5237
0x66bd2b do_traverse_symtree
        ../.././src/gcc/fortran/symbol.c:3926
0x6a4372 generate_local_vars
        ../.././src/gcc/fortran/trans-decl.c:5427
0x6a4372 gfc_generate_function_code(gfc_namespace*)
        ../.././src/gcc/fortran/trans-decl.c:6106
0x684141 gfc_generate_module_code(gfc_namespace*)
        ../.././src/gcc/fortran/trans.c:2058
0x63c86b translate_all_program_units
        ../.././src/gcc/fortran/parse.c:5830
0x63c86b gfc_parse_file()
        ../.././src/gcc/fortran/parse.c:6049
0x67de02 gfc_be_parse_file
        ../.././src/gcc/fortran/f95-lang.c:201
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Dominique d'Humieres 2016-06-20 14:24:18 UTC
Duplicate of pr70864?
Comment 2 Ian Harvey 2016-06-21 23:01:00 UTC
Likely so.

*** This bug has been marked as a duplicate of bug 70864 ***