https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102689
Bug ID: 102689
Summary: Segfault with RESHAPE of CLASS as actual argument
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
Target Milestone: ---
Created attachment 51586
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51586&action=edit
testcase - compile & run (fails with segfault at marked line)
Dummy and actual argument are CLASS, then:
call class_bar (RESHAPE (B, [100]))
will segfault at runtime. Besides the actual crash, the question is why there
is a call to the library at all:
_gfortran_reshape_4 (&atmp.25, D.4357, D.4383, 0B, 0B);
At least for most common cases, it looks as if this should be inlined.