public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] fortran/97652 - workaround missing canonicalization of PDT types
@ 2020-11-03 11:34 Richard Biener
  2020-11-03 12:08 ` Paul Richard Thomas
  2020-11-03 12:14 ` Tobias Burnus
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Biener @ 2020-11-03 11:34 UTC (permalink / raw)
  To: gcc-patches; +Cc: fortran, tobias

This marks PDT types as needing structural comparison for TBAA
if we didn't pick up a canonical variant (which we should IMHO
always do).  This workaround fixes the gfortran.dg/pdt_14.f03
fail which materializes as testsuite timeout which is quite
annoying.

Bootstrap / regtest pending on x86_64-unknown-linux-gnu.

OK?

2020-11-03  Richard Biener  <rguenther@suse.de>

	PR fortran/97652
gcc/fortran
	* trans-types.c (gfc_get_derived_type): When we didn't find
	a canonical type mark it for structual equality.
---
 gcc/fortran/trans-types.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index b7129dcbe6d..4643fff243f 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -2647,6 +2647,8 @@ gfc_get_derived_type (gfc_symbol * derived, int codimen)
       typenode = make_node (RECORD_TYPE);
       TYPE_NAME (typenode) = get_identifier (derived->name);
       TYPE_PACKED (typenode) = flag_pack_derived;
+      if (!got_canonical)
+	SET_TYPE_STRUCTURAL_EQUALITY (typenode);
       derived->backend_decl = typenode;
     }
 
-- 
2.26.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fortran/97652 - workaround missing canonicalization of PDT types
  2020-11-03 11:34 [PATCH] fortran/97652 - workaround missing canonicalization of PDT types Richard Biener
@ 2020-11-03 12:08 ` Paul Richard Thomas
  2020-11-03 12:38   ` Richard Biener
  2020-11-03 12:14 ` Tobias Burnus
  1 sibling, 1 reply; 4+ messages in thread
From: Paul Richard Thomas @ 2020-11-03 12:08 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, Tobias Burnus, fortran

Hi Richi,

That's OK for master and as far back as you have the fortitude to go.

Thanks for the fix.

I agree that we should always pick up a canonical variant. When I finally
get "a minute or two" to fix the rather fundamental problems with PDTs, I
will make sure that this goes away. I am also curious about the time out -
I'll take a look.

Paul


On Tue, 3 Nov 2020 at 11:35, Richard Biener <rguenther@suse.de> wrote:

> This marks PDT types as needing structural comparison for TBAA
> if we didn't pick up a canonical variant (which we should IMHO
> always do).  This workaround fixes the gfortran.dg/pdt_14.f03
> fail which materializes as testsuite timeout which is quite
> annoying.
>
> Bootstrap / regtest pending on x86_64-unknown-linux-gnu.
>
> OK?
>
> 2020-11-03  Richard Biener  <rguenther@suse.de>
>
>         PR fortran/97652
> gcc/fortran
>         * trans-types.c (gfc_get_derived_type): When we didn't find
>         a canonical type mark it for structual equality.
> ---
>  gcc/fortran/trans-types.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
> index b7129dcbe6d..4643fff243f 100644
> --- a/gcc/fortran/trans-types.c
> +++ b/gcc/fortran/trans-types.c
> @@ -2647,6 +2647,8 @@ gfc_get_derived_type (gfc_symbol * derived, int
> codimen)
>        typenode = make_node (RECORD_TYPE);
>        TYPE_NAME (typenode) = get_identifier (derived->name);
>        TYPE_PACKED (typenode) = flag_pack_derived;
> +      if (!got_canonical)
> +       SET_TYPE_STRUCTURAL_EQUALITY (typenode);
>        derived->backend_decl = typenode;
>      }
>
> --
> 2.26.2
>


-- 
"If you can't explain it simply, you don't understand it well enough" -
Albert Einstein

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fortran/97652 - workaround missing canonicalization of PDT types
  2020-11-03 11:34 [PATCH] fortran/97652 - workaround missing canonicalization of PDT types Richard Biener
  2020-11-03 12:08 ` Paul Richard Thomas
@ 2020-11-03 12:14 ` Tobias Burnus
  1 sibling, 0 replies; 4+ messages in thread
From: Tobias Burnus @ 2020-11-03 12:14 UTC (permalink / raw)
  To: Richard Biener, gcc-patches; +Cc: tobias, fortran

On 03.11.20 12:34, Richard Biener wrote:

> This marks PDT types as needing structural comparison for TBAA
> if we didn't pick up a canonical variant (which we should IMHO
> always do).  This workaround fixes the gfortran.dg/pdt_14.f03
> fail which materializes as testsuite timeout which is quite
> annoying.
>
> Bootstrap / regtest pending on x86_64-unknown-linux-gnu.
> OK?

OK as workaround; still, the question is why it does not find its
sibling – thus, we shall keep the PR open (or open a follow-up PR) to
fix it properly.

Tobias


> 2020-11-03  Richard Biener  <rguenther@suse.de>
>
>       PR fortran/97652
> gcc/fortran
>       * trans-types.c (gfc_get_derived_type): When we didn't find
>       a canonical type mark it for structual equality.
> ---
>   gcc/fortran/trans-types.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
> index b7129dcbe6d..4643fff243f 100644
> --- a/gcc/fortran/trans-types.c
> +++ b/gcc/fortran/trans-types.c
> @@ -2647,6 +2647,8 @@ gfc_get_derived_type (gfc_symbol * derived, int codimen)
>         typenode = make_node (RECORD_TYPE);
>         TYPE_NAME (typenode) = get_identifier (derived->name);
>         TYPE_PACKED (typenode) = flag_pack_derived;
> +      if (!got_canonical)
> +     SET_TYPE_STRUCTURAL_EQUALITY (typenode);
>         derived->backend_decl = typenode;
>       }
>
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fortran/97652 - workaround missing canonicalization of PDT types
  2020-11-03 12:08 ` Paul Richard Thomas
@ 2020-11-03 12:38   ` Richard Biener
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2020-11-03 12:38 UTC (permalink / raw)
  To: Paul Richard Thomas; +Cc: gcc-patches, Tobias Burnus, fortran

On Tue, 3 Nov 2020, Paul Richard Thomas wrote:

> Hi Richi,
> 
> That's OK for master and as far back as you have the fortitude to go.

We only know that the issue is exposed on trunk so I'll leave it
there only as a temporary workaround.

> Thanks for the fix.
> 
> I agree that we should always pick up a canonical variant. When I finally
> get "a minute or two" to fix the rather fundamental problems with PDTs, I
> will make sure that this goes away. I am also curious about the time out -
> I'll take a look.

Note the timeout happens because we optimize one loop to an endless
loop, the reason is mentioned in the PRs audit-trail.

Thanks,
Richard.

> 
> Paul
> 
> 
> On Tue, 3 Nov 2020 at 11:35, Richard Biener <rguenther@suse.de> wrote:
> 
> > This marks PDT types as needing structural comparison for TBAA
> > if we didn't pick up a canonical variant (which we should IMHO
> > always do).  This workaround fixes the gfortran.dg/pdt_14.f03
> > fail which materializes as testsuite timeout which is quite
> > annoying.
> >
> > Bootstrap / regtest pending on x86_64-unknown-linux-gnu.
> >
> > OK?
> >
> > 2020-11-03  Richard Biener  <rguenther@suse.de>
> >
> >         PR fortran/97652
> > gcc/fortran
> >         * trans-types.c (gfc_get_derived_type): When we didn't find
> >         a canonical type mark it for structual equality.
> > ---
> >  gcc/fortran/trans-types.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
> > index b7129dcbe6d..4643fff243f 100644
> > --- a/gcc/fortran/trans-types.c
> > +++ b/gcc/fortran/trans-types.c
> > @@ -2647,6 +2647,8 @@ gfc_get_derived_type (gfc_symbol * derived, int
> > codimen)
> >        typenode = make_node (RECORD_TYPE);
> >        TYPE_NAME (typenode) = get_identifier (derived->name);
> >        TYPE_PACKED (typenode) = flag_pack_derived;
> > +      if (!got_canonical)
> > +       SET_TYPE_STRUCTURAL_EQUALITY (typenode);
> >        derived->backend_decl = typenode;
> >      }
> >
> > --
> > 2.26.2
> >
> 
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imend

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-03 12:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 11:34 [PATCH] fortran/97652 - workaround missing canonicalization of PDT types Richard Biener
2020-11-03 12:08 ` Paul Richard Thomas
2020-11-03 12:38   ` Richard Biener
2020-11-03 12:14 ` Tobias Burnus

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).