public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-115070-4-52tMQjWjKB@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115070-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gmail dot com,
                   |                            |pault at gcc dot gnu.org

--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> ---
(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 = *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 != 0B)
        {
          {
            struct array00_my_type desc.1;

            desc.1.dtype = {.elem_len=4, .rank=0, .type=5};
            desc.1.data = (void * restrict) obs->_data;
            desc.1.span = (integer(kind=8)) 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. This
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 = 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

  parent reply	other threads:[~2024-05-15  6:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13 14:23 [Bug fortran/115070] New: ICE using IEEE_ARITHMETIC in a derived type method with intent(out) statement bardeau at iram dot fr
2024-05-13 17:09 ` [Bug fortran/115070] [13/14/15 Regression] ICE using IEEE_ARITHMETIC in a derived type method with class, intent(out) anlauf at gcc dot gnu.org
2024-05-13 17:24 ` anlauf at gcc dot gnu.org
2024-05-15  6:31 ` pault at gcc dot gnu.org [this message]
2024-05-16 10:00 ` bardeau at iram dot fr
2024-05-16 10:17 ` fxcoudert at gcc dot gnu.org
2024-05-16 10:59 ` fxcoudert at gcc dot gnu.org
2024-05-17 14:32 ` pault at gcc dot gnu.org
2024-05-21  9:20 ` jakub at gcc dot gnu.org
2024-05-21 12:03 ` pault at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-115070-4-52tMQjWjKB@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).