From: Harald Anlauf <anlauf@gmx.de>
To: Paul Richard Thomas <paul.richard.thomas@gmail.com>,
"fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Cc: trnka@scm.com
Subject: Re: [Patch, fortran] PR112407 - [13/14 Regression] Fix for PR37336 triggers an ICE in gfc_format_decoder while constructing a vtab
Date: Sat, 30 Mar 2024 15:52:45 +0100 [thread overview]
Message-ID: <c5538067-194c-404f-9661-20586d7e0f64@gmx.de> (raw)
In-Reply-To: <CAGkQGi+aQ+u-rkEsp=tX8vfW8wabDMotRvte+N7pqcTT5iM_Yg@mail.gmail.com>
Hi Paul,
I had only a quick glance at your patch. I guess you unintentionally
forgot to remove those parts that you already committed for PR110987,
along with the finalize-testcases.
I am still trying to find the precise paragraph in the standard
you refer to regarding INTENT(OUT) and default initialization.
While at it, I think I found a minor nit in testcase pr112407a.f90:
component x%i appears undefined the first time it is printed.
This can be verified by either adding an explicit
x% i = -42
in the main after the allocate(x). Alternatively, running the
code with Intel and using MALLOC_PERTURB_ shows a random arg1%i,
but is otherwise fine. However, if by chance (random memory)
x% i = +42
then the test would likely fail everywhere.
Cheers,
Harald
Am 30.03.24 um 10:06 schrieb Paul Richard Thomas:
> Hi All,
>
> This bug emerged in a large code and involves possible recursion with a
> "hidden" module procedure; ie. where the symtree name starts with '@'. This
> throws the format decoder. As the last message in the PR shows, I have
> vacillated between silently passing on the possible recursion or adding an
> alternative warning message. In the end, as a conservative choice I went
> for emitting the message.
>
> In the course of trying to develop a compact test case, I found that type
> bound procedures were not being tested for recursion and that class
> dummies, with intent out, were being incorrectly initialized with an empty
> default initializer. Both of these have been fixed.
>
> Unfortunately, the most compact reproducer that Tomas was able to come up
> with required more than 100kbytes of module files. I tried from the bottom
> up but failed. Both the tests check the fixes for the other bugs.
>
> Regtests on x86_64 - OK for mainline and, in a couple of weeks, 13-branch?
>
> Paul
>
> Fortran: Fix wrong recursive errors and class initialization [PR112407]
>
> 2024-03-30 Paul Thomas <pault@gcc.gnu.org>
>
> gcc/fortran
> PR fortran/112407
> *resolve.cc (resolve_procedure_expression): Change the test for
> for recursion in the case of hidden procedures from modules.
> (resolve_typebound_static): Add warning for possible recursive
> calls to typebound procedures.
> * trans-expr.cc (gfc_trans_class_init_assign): Do not apply
> default initializer to class dummy where component initializers
> are all null.
>
> gcc/testsuite/
> PR fortran/112407
> * gfortran.dg/pr112407a.f90: New test.
> * gfortran.dg/pr112407b.f90: New test.
>
WARNING: multiple messages have this Message-ID
From: Harald Anlauf <anlauf@gmx.de>
To: gcc-patches@gcc.gnu.org
Cc: fortran@gcc.gnu.org
Subject: Re: [Patch, fortran] PR112407 - [13/14 Regression] Fix for PR37336 triggers an ICE in gfc_format_decoder while constructing a vtab
Date: Sat, 30 Mar 2024 15:52:45 +0100 [thread overview]
Message-ID: <c5538067-194c-404f-9661-20586d7e0f64@gmx.de> (raw)
Message-ID: <20240330145245.lp_EqOcfl520iymwnniCVo99HdTeE-4q-xl98J8dPeI@z> (raw)
In-Reply-To: <CAGkQGi+aQ+u-rkEsp=tX8vfW8wabDMotRvte+N7pqcTT5iM_Yg@mail.gmail.com>
Hi Paul,
I had only a quick glance at your patch. I guess you unintentionally
forgot to remove those parts that you already committed for PR110987,
along with the finalize-testcases.
I am still trying to find the precise paragraph in the standard
you refer to regarding INTENT(OUT) and default initialization.
While at it, I think I found a minor nit in testcase pr112407a.f90:
component x%i appears undefined the first time it is printed.
This can be verified by either adding an explicit
x% i = -42
in the main after the allocate(x). Alternatively, running the
code with Intel and using MALLOC_PERTURB_ shows a random arg1%i,
but is otherwise fine. However, if by chance (random memory)
x% i = +42
then the test would likely fail everywhere.
Cheers,
Harald
Am 30.03.24 um 10:06 schrieb Paul Richard Thomas:
> Hi All,
>
> This bug emerged in a large code and involves possible recursion with a
> "hidden" module procedure; ie. where the symtree name starts with '@'. This
> throws the format decoder. As the last message in the PR shows, I have
> vacillated between silently passing on the possible recursion or adding an
> alternative warning message. In the end, as a conservative choice I went
> for emitting the message.
>
> In the course of trying to develop a compact test case, I found that type
> bound procedures were not being tested for recursion and that class
> dummies, with intent out, were being incorrectly initialized with an empty
> default initializer. Both of these have been fixed.
>
> Unfortunately, the most compact reproducer that Tomas was able to come up
> with required more than 100kbytes of module files. I tried from the bottom
> up but failed. Both the tests check the fixes for the other bugs.
>
> Regtests on x86_64 - OK for mainline and, in a couple of weeks, 13-branch?
>
> Paul
>
> Fortran: Fix wrong recursive errors and class initialization [PR112407]
>
> 2024-03-30 Paul Thomas <pault@gcc.gnu.org>
>
> gcc/fortran
> PR fortran/112407
> *resolve.cc (resolve_procedure_expression): Change the test for
> for recursion in the case of hidden procedures from modules.
> (resolve_typebound_static): Add warning for possible recursive
> calls to typebound procedures.
> * trans-expr.cc (gfc_trans_class_init_assign): Do not apply
> default initializer to class dummy where component initializers
> are all null.
>
> gcc/testsuite/
> PR fortran/112407
> * gfortran.dg/pr112407a.f90: New test.
> * gfortran.dg/pr112407b.f90: New test.
>
next prev parent reply other threads:[~2024-03-30 14:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-30 9:06 Paul Richard Thomas
2024-03-30 14:52 ` Harald Anlauf [this message]
2024-03-30 14:52 ` Harald Anlauf
2024-03-31 12:08 ` Paul Richard Thomas
2024-04-01 20:04 ` Harald Anlauf
2024-04-01 20:04 ` Harald Anlauf
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=c5538067-194c-404f-9661-20586d7e0f64@gmx.de \
--to=anlauf@gmx.de \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=paul.richard.thomas@gmail.com \
--cc=trnka@scm.com \
/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).