http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51970
Bug #: 51970 Summary: gimplification failed for an avatar of pr51948 Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: domi...@lps.ens.fr CC: bur...@net-b.de Compiling the following (invalid?) avatar of pr51948 type t end type t contains function func(x) class(t), allocatable :: x(:), func2(:) call move_alloc (x, func2) ! FAILS: Error: the 'from' and 'to' arguments of 'move_alloc' intrinsic at (1) must have the same rank 0/1 end function function func2(x) type(t), allocatable :: x class(t), allocatable :: func2 call move_alloc (x, func2) ! FAILS: Error: 'to' argument of 'move_alloc' intrinsic at (1) must be a variable end function end gives the following ICE gimplification failed: &func2._data <addr_expr 0x142d38550 type <pointer_type 0x142d332a0 type <record_type 0x142d2fdc8 array1_t type_1 BLK size <integer_cst 0x142d0db80 constant 384> unit size <integer_cst 0x142d0d600 constant 48> align 64 symtab 0 alias set -1 canonical type 0x142d2fe70 fields <field_decl 0x142d21a18 data> pointer_to_this <pointer_type 0x142d332a0> chain <type_decl 0x142d310b8 D.1886>> public unsigned DI size <integer_cst 0x142c0c940 constant 64> unit size <integer_cst 0x142c0c960 constant 8> align 64 symtab 0 alias set -1 canonical type 0x142d33348> arg 0 <component_ref 0x142d0c540 type <record_type 0x142d2fdc8 array1_t> arg 0 <var_decl 0x142c0e640 func2 type <record_type 0x142d2f9d8 __class_MAIN___T_1_a> addressable used BLK file pr51948_db.f90 line 6 col 0 size <integer_cst 0x142d0d820 constant 448> unit size <integer_cst 0x142d0d860 constant 56> align 64 context <function_decl 0x142d2a500 func>> arg 1 <field_decl 0x142d32130 _data type <record_type 0x142d2fdc8 array1_t> BLK file pr51948_db.f90 line 6 col 0 size <integer_cst 0x142d0db80 384> unit size <integer_cst 0x142d0d600 48> align 64 offset_align 128 offset <integer_cst 0x142c0c980 constant 0> bit offset <integer_cst 0x142c0c9e0 constant 0> context <record_type 0x142d2f9d8 __class_MAIN___T_1_a> chain <field_decl 0x142d321c8 _vptr>> pr51948_db.f90:7:0> pr51948_db.f90:7:0> pr51948_db.f90: In function 'func': pr51948_db.f90:7:0: internal compiler error: gimplification failed This may due to the patch at http://gcc.gnu.org/ml/fortran/2012-01/msg00213.html . The code is accepted by trunk r183357.