public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/96012] New: [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558
@ 2020-06-30 20:10 gscfq@t-online.de
  2020-07-01  6:51 ` [Bug fortran/96012] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gscfq@t-online.de @ 2020-06-30 20:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96012
           Summary: [9/10/11 Regression] ICE in fold_convert_loc, at
                    fold-const.c:2558
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed between 20181014 and 20181021, affects versions down to r8 :


$ cat z1.f90
program p
   type t
   end type
   class(*), allocatable :: x(:)
   x = [t()]
end


$ cat z2.f90
program p
   type t
      integer :: a
   end type
   class(*), allocatable :: x(:)
   x = [t(1)]
end


$ gfortran-7 -c z1.f90
$
$ gfortran-11-20200628 -c z1.f90
z1.f90:5:0:

    5 |    x = [t()]
      |
internal compiler error: in fold_convert_loc, at fold-const.c:2558
0x900033 fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gcc/fold-const.c:2558
0x705f6a gfc_allocate_using_malloc(stmtblock_t*, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fortran/trans.c:714
0x7456ab trans_class_assignment
        ../../gcc/fortran/trans-expr.c:10649
0x7456ab gfc_trans_assignment_1
        ../../gcc/fortran/trans-expr.c:11042
0x704c37 trans_code
        ../../gcc/fortran/trans.c:1864
0x72e1d4 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6840
0x6b5cb6 translate_all_program_units
        ../../gcc/fortran/parse.c:6307
0x6b5cb6 gfc_parse_file()
        ../../gcc/fortran/parse.c:6546
0x7016ff gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/96012] [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558
  2020-06-30 20:10 [Bug fortran/96012] New: [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558 gscfq@t-online.de
@ 2020-07-01  6:51 ` rguenth at gcc dot gnu.org
  2020-07-01  7:06 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-01  6:51 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
   Target Milestone|---                         |9.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/96012] [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558
  2020-06-30 20:10 [Bug fortran/96012] New: [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558 gscfq@t-online.de
  2020-07-01  6:51 ` [Bug fortran/96012] " rguenth at gcc dot gnu.org
@ 2020-07-01  7:06 ` marxin at gcc dot gnu.org
  2020-12-18 14:00 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-07-01  7:06 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-07-01

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r9-3522-gd0477233215e37de.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/96012] [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558
  2020-06-30 20:10 [Bug fortran/96012] New: [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558 gscfq@t-online.de
  2020-07-01  6:51 ` [Bug fortran/96012] " rguenth at gcc dot gnu.org
  2020-07-01  7:06 ` marxin at gcc dot gnu.org
@ 2020-12-18 14:00 ` cvs-commit at gcc dot gnu.org
  2020-12-20 10:16 ` drikosev at gmail dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-18 14:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

https://gcc.gnu.org/g:ce8dcc9105cbd4043d575d8b2c91309a423951a9

commit r11-6253-gce8dcc9105cbd4043d575d8b2c91309a423951a9
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Fri Dec 18 14:00:11 2020 +0000

    As well as the PR this patch fixes problems in handling class objects

    2020-12-18  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/83118
            PR fortran/96012
            * resolve.c (resolve_ordinary_assign): Generate a vtable if
            necessary for scalar non-polymorphic rhs's to unlimited lhs's.
            * trans-array.c (get_class_info_from_ss): New function.
            (gfc_trans_allocate_array_storage): Defer obtaining class
            element type until all sources of class exprs are tried. Use
            class API rather than TREE_OPERAND. Look for class expressions
            in ss->info by calling get_class_info_from_ss. After, obtain
            the element size for class descriptors. Where the element type
            is unknown, cast the data as character(len=size) to overcome
            unlimited polymorphic problems.
            (gfc_conv_ss_descriptor): Do not fix class variable refs.
            (build_class_array_ref, structure_alloc_comps): Replace code
            replicating the new function gfc_resize_class_size_with_len.
            (gfc_alloc_allocatable_for_assignment): Obtain element size
            for lhs in cases of deferred characters and class enitities.
            Move code for the element size of rhs to start of block. Clean
            up extraction of class parameters throughout this function.
            After the shape check test whether or not the lhs and rhs
            element sizes are the same. Use earlier evaluation of
            'cond_null'. Reallocation of lhs only to happen if size changes
            or element size changes.
            * trans-expr.c (gfc_resize_class_size_with_len): New function.
            (gfc_get_class_from_expr): If a constant expression is
            encountered, return NULL_TREE;
            (trans_scalar_class_assign): New function.
            (gfc_conv_procedure_call): Ensure the vtable is present for
            passing a non-class actual to an unlimited formal.
            (trans_class_vptr_len_assignment): For expressions of type
            BT_CLASS, extract the class expression if necessary. Use a
            statement block outside the loop body. Ensure that 'rhs' is
            of the correct type. Obtain rhs vptr in all circumstances.
            (gfc_trans_scalar_assign): Call trans_scalar_class_assign to
            make maximum use of the vptr copy in place of assignment.
            (trans_class_assignment): Actually do reallocation if needed.
            (gfc_trans_assignment_1): Simplify some of the logic with
            'realloc_flag'. Set 'vptr_copy' for all array assignments to
            unlimited polymorphic lhs.
            * trans.c (gfc_build_array_ref): Call gfc_resize_class_size_
            with_len to correct span for unlimited polymorphic decls.
            * trans.h : Add prototype for gfc_resize_class_size_with_len.

    gcc/testsuite/
            PR fortran/83118
            PR fortran/96012
            * gfortran.dg/dependency_60.f90: New test.
            * gfortran.dg/class_allocate_25.f90: New test.
            * gfortran.dg/class_assign_4.f90: New test.
            * gfortran.dg/unlimited_polymorphic_32.f03: New test.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/96012] [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558
  2020-06-30 20:10 [Bug fortran/96012] New: [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-12-18 14:00 ` cvs-commit at gcc dot gnu.org
@ 2020-12-20 10:16 ` drikosev at gmail dot com
  2021-01-07 11:19 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: drikosev at gmail dot com @ 2020-12-20 10:16 UTC (permalink / raw)
  To: gcc-bugs

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

Ev Drikos <drikosev at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |drikosev at gmail dot com

--- Comment #3 from Ev Drikos <drikosev at gmail dot com> ---
Created attachment 49809
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49809&action=edit
deferred length character array


Hello P. Thomas,

At first, this is obviously a complex patch, which as
it seems should normally have no regressions, so far.

It's my impression that the attachment is relevant,
ie due to variable realloc_flag in trans-expr.c, but
currently I can't rebuild the code from trunk. So,
I can't be sure if the test case would fail or pass.   

Note that this example have been submitted to c.l.f
by a third person, I haven't written it.

Hope this helps,
Ev. Drikos

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/96012] [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558
  2020-06-30 20:10 [Bug fortran/96012] New: [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-12-20 10:16 ` drikosev at gmail dot com
@ 2021-01-07 11:19 ` cvs-commit at gcc dot gnu.org
  2021-01-07 11:34 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-07 11:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

https://gcc.gnu.org/g:10dde773d2d6866cbca3f7323a64130339e36007

commit r10-9229-g10dde773d2d6866cbca3f7323a64130339e36007
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Fri Dec 18 14:00:11 2020 +0000

    As well as the PR this patch fixes problems in handling class objects

    2020-12-18  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/83118
            PR fortran/96012
            * resolve.c (resolve_ordinary_assign): Generate a vtable if
            necessary for scalar non-polymorphic rhs's to unlimited lhs's.
            * trans-array.c (get_class_info_from_ss): New function.
            (gfc_trans_allocate_array_storage): Defer obtaining class
            element type until all sources of class exprs are tried. Use
            class API rather than TREE_OPERAND. Look for class expressions
            in ss->info by calling get_class_info_from_ss. After, obtain
            the element size for class descriptors. Where the element type
            is unknown, cast the data as character(len=size) to overcome
            unlimited polymorphic problems.
            (gfc_conv_ss_descriptor): Do not fix class variable refs.
            (build_class_array_ref, structure_alloc_comps): Replace code
            replicating the new function gfc_resize_class_size_with_len.
            (gfc_alloc_allocatable_for_assignment): Obtain element size
            for lhs in cases of deferred characters and class enitities.
            Move code for the element size of rhs to start of block. Clean
            up extraction of class parameters throughout this function.
            After the shape check test whether or not the lhs and rhs
            element sizes are the same. Use earlier evaluation of
            'cond_null'. Reallocation of lhs only to happen if size changes
            or element size changes.
            * trans-expr.c (gfc_resize_class_size_with_len): New function.
            (gfc_get_class_from_expr): If a constant expression is
            encountered, return NULL_TREE;
            (trans_scalar_class_assign): New function.
            (gfc_conv_procedure_call): Ensure the vtable is present for
            passing a non-class actual to an unlimited formal.
            (trans_class_vptr_len_assignment): For expressions of type
            BT_CLASS, extract the class expression if necessary. Use a
            statement block outside the loop body. Ensure that 'rhs' is
            of the correct type. Obtain rhs vptr in all circumstances.
            (gfc_trans_scalar_assign): Call trans_scalar_class_assign to
            make maximum use of the vptr copy in place of assignment.
            (trans_class_assignment): Actually do reallocation if needed.
            (gfc_trans_assignment_1): Simplify some of the logic with
            'realloc_flag'. Set 'vptr_copy' for all array assignments to
            unlimited polymorphic lhs.
            * trans.c (gfc_build_array_ref): Call gfc_resize_class_size_
            with_len to correct span for unlimited polymorphic decls.
            * trans.h : Add prototype for gfc_resize_class_size_with_len.

    gcc/testsuite/
            PR fortran/83118
            PR fortran/96012
            * gfortran.dg/dependency_60.f90: New test.
            * gfortran.dg/class_allocate_25.f90: New test.
            * gfortran.dg/class_assign_4.f90: New test.
            * gfortran.dg/unlimited_polymorphic_32.f03: New test.

    (cherry picked from commit ce8dcc9105cbd4043d575d8b2c91309a423951a9)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/96012] [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558
  2020-06-30 20:10 [Bug fortran/96012] New: [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-01-07 11:19 ` cvs-commit at gcc dot gnu.org
@ 2021-01-07 11:34 ` cvs-commit at gcc dot gnu.org
  2021-03-26 19:44 ` anlauf at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-07 11:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

https://gcc.gnu.org/g:e780e940a9f53b93bdf6bd70fdb3ec2b287a52e3

commit r9-9158-ge780e940a9f53b93bdf6bd70fdb3ec2b287a52e3
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Fri Dec 18 14:00:11 2020 +0000

    As well as the PR this patch fixes problems in handling class objects

    2020-12-18  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/83118
            PR fortran/96012
            * resolve.c (resolve_ordinary_assign): Generate a vtable if
            necessary for scalar non-polymorphic rhs's to unlimited lhs's.
            * trans-array.c (get_class_info_from_ss): New function.
            (gfc_trans_allocate_array_storage): Defer obtaining class
            element type until all sources of class exprs are tried. Use
            class API rather than TREE_OPERAND. Look for class expressions
            in ss->info by calling get_class_info_from_ss. After, obtain
            the element size for class descriptors. Where the element type
            is unknown, cast the data as character(len=size) to overcome
            unlimited polymorphic problems.
            (gfc_conv_ss_descriptor): Do not fix class variable refs.
            (build_class_array_ref, structure_alloc_comps): Replace code
            replicating the new function gfc_resize_class_size_with_len.
            (gfc_alloc_allocatable_for_assignment): Obtain element size
            for lhs in cases of deferred characters and class enitities.
            Move code for the element size of rhs to start of block. Clean
            up extraction of class parameters throughout this function.
            After the shape check test whether or not the lhs and rhs
            element sizes are the same. Use earlier evaluation of
            'cond_null'. Reallocation of lhs only to happen if size changes
            or element size changes.
            * trans-expr.c (gfc_resize_class_size_with_len): New function.
            (gfc_get_class_from_expr): If a constant expression is
            encountered, return NULL_TREE;
            (trans_scalar_class_assign): New function.
            (gfc_conv_procedure_call): Ensure the vtable is present for
            passing a non-class actual to an unlimited formal.
            (trans_class_vptr_len_assignment): For expressions of type
            BT_CLASS, extract the class expression if necessary. Use a
            statement block outside the loop body. Ensure that 'rhs' is
            of the correct type. Obtain rhs vptr in all circumstances.
            (gfc_trans_scalar_assign): Call trans_scalar_class_assign to
            make maximum use of the vptr copy in place of assignment.
            (trans_class_assignment): Actually do reallocation if needed.
            (gfc_trans_assignment_1): Simplify some of the logic with
            'realloc_flag'. Set 'vptr_copy' for all array assignments to
            unlimited polymorphic lhs.
            * trans.c (gfc_build_array_ref): Call gfc_resize_class_size_
            with_len to correct span for unlimited polymorphic decls.
            * trans.h : Add prototype for gfc_resize_class_size_with_len.

    gcc/testsuite/
            PR fortran/83118
            PR fortran/96012
            * gfortran.dg/dependency_60.f90: New test.
            * gfortran.dg/class_allocate_25.f90: New test.
            * gfortran.dg/class_assign_4.f90: New test.
            * gfortran.dg/unlimited_polymorphic_32.f03: New test.

    (cherry picked from commit ce8dcc9105cbd4043d575d8b2c91309a423951a9)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/96012] [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558
  2020-06-30 20:10 [Bug fortran/96012] New: [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-01-07 11:34 ` cvs-commit at gcc dot gnu.org
@ 2021-03-26 19:44 ` anlauf at gcc dot gnu.org
  2021-06-01  8:17 ` [Bug fortran/96012] [9/10/11/12 " rguenth at gcc dot gnu.org
  2021-06-01 12:18 ` dominiq at lps dot ens.fr
  8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-03-26 19:44 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #6 from anlauf at gcc dot gnu.org ---
This PR appears to remain an 8-only regression, as the testcases in comment#0
do compile now.

Shall this PR be closed?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/96012] [9/10/11/12 Regression] ICE in fold_convert_loc,  at fold-const.c:2558
  2020-06-30 20:10 [Bug fortran/96012] New: [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2021-03-26 19:44 ` anlauf at gcc dot gnu.org
@ 2021-06-01  8:17 ` rguenth at gcc dot gnu.org
  2021-06-01 12:18 ` dominiq at lps dot ens.fr
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:17 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/96012] [9/10/11/12 Regression] ICE in fold_convert_loc,  at fold-const.c:2558
  2020-06-30 20:10 [Bug fortran/96012] New: [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558 gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2021-06-01  8:17 ` [Bug fortran/96012] [9/10/11/12 " rguenth at gcc dot gnu.org
@ 2021-06-01 12:18 ` dominiq at lps dot ens.fr
  8 siblings, 0 replies; 10+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-06-01 12:18 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> This PR appears to remain an 8-only regression, as the testcases in comment#0
> do compile now.

GCC8 is closed, so closing.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-06-01 12:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-30 20:10 [Bug fortran/96012] New: [9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2558 gscfq@t-online.de
2020-07-01  6:51 ` [Bug fortran/96012] " rguenth at gcc dot gnu.org
2020-07-01  7:06 ` marxin at gcc dot gnu.org
2020-12-18 14:00 ` cvs-commit at gcc dot gnu.org
2020-12-20 10:16 ` drikosev at gmail dot com
2021-01-07 11:19 ` cvs-commit at gcc dot gnu.org
2021-01-07 11:34 ` cvs-commit at gcc dot gnu.org
2021-03-26 19:44 ` anlauf at gcc dot gnu.org
2021-06-01  8:17 ` [Bug fortran/96012] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-06-01 12:18 ` dominiq at lps dot ens.fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).