From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A5956385840D; Wed, 15 May 2024 06:31:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5956385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715754713; bh=qG69emB5Q3n7ZDqeBSm7INOvVYIMgjgKYviXco0is7w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lRgv7NN5ZLUgsN5RAzeN+2U33KhzpdnzfptELIowknYMOFiErfCl2XZBWC3CjF/v2 vnmQl2ohEWiPjydHk3DYTS5NRI7MA/ACt4FHh0Cvqt6MtN8q8UdnjiWnbsS7b7Vz9a I0HpCTW+Dt2eIwSMUPUF3CWw8xzfbNmkswSc39Us= From: "pault at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/115070] [13/14/15 Regression] ICE using IEEE_ARITHMETIC in a derived type method with class, intent(out) Date: Wed, 15 May 2024 06:31:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pault at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115070 Paul Thomas changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gmail dot com, | |pault at gcc dot gnu.org --- Comment #3 from Paul Thomas --- (In reply to anlauf from comment #2) > Replacing the scalar argument 'obs' by something with rank > 0 avoids the > ICE, > but then assumed-rank is not accepted with intent(out). Another bug... The tree output with 12-branch is: __attribute__((fn spec (". r w "))) void __copy_my_mod_My_type (struct my_type & restrict src, struct my_type & restrict dst) { *dst =3D *src; } __attribute__((fn spec (". w "))) void my_sub (struct __class_my_mod_My_type_t & restrict obs) { c_char fpstate.0[33]; try { _gfortran_ieee_procedure_entry ((void *) &fpstate.0); if (obs->_vptr->_final !=3D 0B) { { struct array00_my_type desc.1; desc.1.dtype =3D {.elem_len=3D4, .rank=3D0, .type=3D5}; desc.1.data =3D (void * restrict) obs->_data; desc.1.span =3D (integer(kind=3D8)) desc.1.dtype.elem_len; obs->_vptr->_final (&desc.1, obs->_vptr->_size, 0); } } (void) __builtin_memcpy ((void *) obs->_data, (void *) obs->_vptr->_def_init, (unsigned long) obs->_vptr->_size); } finally { _gfortran_ieee_procedure_exit ((void *) &fpstate.0); } } 13- through 15-branches lack the default copy of the default initializer. T= his disappeared with the fix for pr112407 and is required by the standard if the derived type has no default initializer. This suggests a workaround, which indeed "works": type my_type integer :: a =3D 0 end type my_type I cannot see anything in the ieee procedures that would cause this but then= I know zip-all about ieee. Putting Francois-Xavier in copy in the hope that he can shed some light. Cheers Paul=