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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pault at gcc dot gnu.org

--- Comment #11 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 58054
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58054&action=edit
Fix for this PR

Hi Orion and Jakub,

Mea culpa, mea maxima culpa! I had totally overlooked the use of
gfc_trans_class_init_assign for application of 'mold' in class allocation.

  subroutine restore_smoothers(level,save1, save2,info)
....snip....
    if (allocated(level%sm)) then
      if (info  == 0) call level%sm%free(info)
      if (info  == 0) deallocate(level%sm,stat=info)
    end if
    if (allocated(save1)) then
      if (info  == 0) allocate(level%sm,mold=save1,stat=info) ! Repeats
below...
      if (info == 0) call save1%clone_settings(level%sm,info)
    end if
....snip....

the attached patch fixes both this problem and respects the standard for the
default initialization of INTENT(OUT) dummies. It regtests fine. A suitable
testcase is on its way.

@Jakub, As per your message of Fri Apr 26 11:03:31, I hope that the patch can
find its way to the 14.1 release candidate.

Regards

Paul

Reply via email to