https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80931

            Bug ID: 80931
           Summary: ICE on move_alloc in gimplify_expr, at
                    gimplify.c:11335
           Product: gcc
           Version: 6.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dev-zero at gentoo dot org
  Target Milestone: ---

Created attachment 41444
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41444&action=edit
minimal example for an ICE on move_alloc for deferred-length character strings

Building the attached file using `LC_ALL=C gfortran -c move_alloc_ice.f90` with
gfortran-6.3.0(-p1) and I get:

move_alloce_ice.f90:29:0:

       call move_alloc(temp, this%keywords_)

internal compiler error: in gimplify_expr, at gimplify.c:11335
0x8f57be gimplify_expr(tree_node**, gimple**, gimple**, bool (*)
It doesn't seem to be a regression since 5.4.0 exhibits the same error:

$ LC_ALL=C gfortran-5.4.0 -c move_alloc_ice.f90 
move_alloc_ice.f90:29:0:

       call move_alloc(temp, this%keywords_)
 ^
internal compiler error: in gimplify_expr, at gimplify.c:9084
0x92511d gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:9084
0x922271 gimplify_modify_expr
        /var/tmp/paludis/sys-devel-gcc-5.4.0-r2(tree_node*), int)
       
/var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:11335
0x8fdc92 gimplify_modify_expr
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:4707
0x8f5141 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:10386
0x8f6da5 gimplify_stmt(tree_node**, gimple**)
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:5687
0x8f482b gimplify_statement_list
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:1537
0x8f482b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:10803
0x8f6da5 gimplify_stmt(tree_node**, gimple**)
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:5687
0x8f7940 gimplify_bind_expr
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:1142
0x8f3a94 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:10585
0x8f6da5 gimplify_stmt(tree_node**, gimple**)
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:5687
0x8f482b gimplify_statement_list
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:1537
0x8f482b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:10803
0x8f6da5 gimplify_stmt(tree_node**, gimple**)
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:5687
0x8f41ea gimplify_and_add(tree_node*, gimple**)
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:425
0x8f41ea gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:10725
0x8f6da5 gimplify_stmt(tree_node**, gimple**)
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:5687
0x8f7940 gimplify_bind_expr
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:1142
0x8f3a94 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:10585
0x8f6da5 gimplify_stmt(tree_node**, gimple**)
        /var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:5687
0x8f80da gimplify_body(tree_node*, bool)
       
/var/tmp/paludis/sys-devel-gcc-6.3.0/work/gcc-6.3.0/gcc/gimplify.c:11532
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.

It has something to do with the Deferred-length character strings because when
I use fixed length characters, the ICE is gone and the code works as intended
(sort of, but that's my problem). Reducing the example to a simple program
didn't exhibit the ICE either, despite the Deferred-length character strings.

It doesn't seem to be a regression since 5.4.0 exhibits the same error:

$ LC_ALL=C gfortran-5.4.0 -c move_alloc_ice.f90 
move_alloc_ice.f90:29:0:

       call move_alloc(temp, this%keywords_)
 ^
internal compiler error: in gimplify_expr, at gimplify.c:9084
0x92511d gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:9084
0x922271 gimplify_modify_expr
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:4648
0x9236f5 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:8147
0x926275 gimplify_stmt(tree_node**, gimple_statement_base**)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:5566
0x9243ab gimplify_statement_list
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:1493
0x9243ab gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:8562
0x926275 gimplify_stmt(tree_node**, gimple_statement_base**)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:5566
0x926b8f gimplify_bind_expr
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:1139
0x9248d3 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:8344
0x926275 gimplify_stmt(tree_node**, gimple_statement_base**)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:5566
0x9243ab gimplify_statement_list
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:1493
0x9243ab gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:8562
0x926275 gimplify_stmt(tree_node**, gimple_statement_base**)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:5566
0x923a67 gimplify_and_add(tree_node*, gimple_statement_base**)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:424
0x923a67 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:8484
0x926275 gimplify_stmt(tree_node**, gimple_statement_base**)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:5566
0x926b8f gimplify_bind_expr
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:1139
0x9248d3 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:8344
0x926275 gimplify_stmt(tree_node**, gimple_statement_base**)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:5566
0x927299 gimplify_body(tree_node*, bool)
       
/var/tmp/paludis/sys-devel-gcc-5.4.0-r2/work/gcc-5.4.0/gcc/gimplify.c:9281
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.

Reply via email to