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

            Bug ID: 114235
           Summary: Object undefined is specific procedure for generic
                    overload in abstract type
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Bader at lrz dot de
  Target Milestone: ---

Created attachment 57613
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57613&action=edit
test case for overloaded addition in an abstract type

The attached program fails with a segmentation fault. Compilation with 
gfortran-13 -g -fbacktrace -Wall -Wextra abstract_overload_01_pos.f90 
yields and executable the execution of which produces the following stack
trace:

Backtrace for this error:
#0  0x7faaea5408c0 in ???
#1  0x7faaea53fa75 in ???
#2  0x7faae9b8f03f in ???
#3  0x7faaeae012a3 in __mod_r_MOD_add_r
        at
/home/reinhold/a2832ba/Documents/fortran_tests/f03/object_oriented/generic_tbps/abstract_overload_01_pos.f90:38
#4  0x7faaeae01dc3 in p_t
        at
/home/reinhold/a2832ba/Documents/fortran_tests/f03/object_oriented/generic_tbps/abstract_overload_01_pos.f90:57
#5  0x7faaeae021ca in main
        at
/home/reinhold/a2832ba/Documents/fortran_tests/f03/object_oriented/generic_tbps/abstract_overload_01_pos.f90:44
Segmentation fault (core dumped)

Uncommenting the debug writeout in line 37 reveals that t2%vec is not allocated
contrary to the fact that the actual argument's component is indeed allocated
prior to invocation of the generic addition.

Reply via email to