http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46408
Summary: [OOP] Segfault when running gfortran.dg/class_allocate_6.f03 Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: bur...@gcc.gnu.org CC: ja...@gcc.gnu.org This might be a known problem, but the test case gfortran.dg/class_allocate_6.f03 fails for me. (The test was added for PR 45451 / PR 46174, which does a deep copy.) To be precise, I get a segfault using when executing the line: allocate(y, source=x) A "PRINT" statement placed directly after that line will not be printed, i.e. it is not a finally/cleanup issue. The segfault disappears if I unset MALLOC_PERTURB_ which indicates the use of an uninitialized variable. Valgrind shows: Conditional jump or move depends on uninitialised value(s) at 0x400C37: __copy_MAIN___t2.1547 (class_allocate_6.f03:7) by 0x400ED4: MAIN__ (class_allocate_6.f03:48) by 0x400FD7: main (class_allocate_6.f03:48) Related: PR 46321 (deep-freeing of polymorphic variables)