public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Harald Anlauf <anlauf@gmx.de>,
	Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, <fortran@gcc.gnu.org>
Subject: Re: [PATCH] PR fortran/102917 - PDT type parameters are not restricted to default integer
Date: Tue, 26 Oct 2021 11:55:10 +0200	[thread overview]
Message-ID: <9493b683-a21f-c9c5-6c53-947c1dd20e09@codesourcery.com> (raw)
In-Reply-To: <trinity-8d97ab0e-4374-4156-8a57-3a347b95044d-1635102052020@3c-app-gmx-bap61>

Dear Harald, dear all,

On 24.10.21 21:00, Harald Anlauf via Fortran wrote:
> I've created PR 102917 for tracking this issue and packaged
> the attached patch.
>
> Regtested on x86_64-pc-linux-gnu.  OK mainline?

OK. I wonder whether a valid len/kind example should be added which uses
such a PDT with non-default-kind integer.

Tobias

>> Gesendet: Freitag, 22. Oktober 2021 um 22:25 Uhr
>> Von: "Steve Kargl" <sgk@troutmask.apl.washington.edu>
>> An: "Harald Anlauf" <anlauf@gmx.de>
>> Cc: fortran@gcc.gnu.org
>> Betreff: Re: PDT type parameters are not restricted to default integer
>>
>> On Fri, Oct 22, 2021 at 10:16:05PM +0200, Harald Anlauf wrote:
>>> Hi Steve,
>>>
>>> Am 22.10.21 um 21:35 schrieb Steve Kargl via Fortran:
>>>> Here's an obvious quick fix.  Please apply.
>>>>
>>>>
>>>> diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
>>>> index 6043e100fbb..e889bb44142 100644
>>>> --- a/gcc/fortran/decl.c
>>>> +++ b/gcc/fortran/decl.c
>>>> @@ -5619,14 +5619,6 @@ match_attr_spec (void)
>>>>                      m = MATCH_ERROR;
>>>>                      goto cleanup;
>>>>                    }
>>>> -        if (current_ts.kind != gfc_default_integer_kind)
>>>> -          {
>>>> -            gfc_error ("Component with LEN attribute at %C must be "
>>>> -                       "default integer kind (%d)",
>>>> -                        gfc_default_integer_kind);
>>>> -            m = MATCH_ERROR;
>>>> -            goto cleanup;
>>>> -          }
>>>>                }
>>>>              else
>>>>                {
>>> I think you are right.  We should always have allowed any integer kind.
>>>
>>> However, have you checked whether this change introduces regressions?
>>> If you don't, somebody else will.  Please open a PR, then.
>>>
>> It seems that pdt_4.f03 will fail with the above patch because
>> it explicitly tests for this error message.  That's the only
>> failure in the testsuite.  For the record, F2003, page 48,
>>
>>     R435 type-param-def-stmt  is INTEGER [ kind-selector ] , ...
>>
>>     Each type parameter is itself of type integer.  If its kind selector
>>     is omitted, the kind type parameter is default integer.
>>
>> Now that I think about and look, there is a nearby similar gcc_error()
>> for KIND.  This should be removed too.
>>
>> --
>> Steve
>>
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

  parent reply	other threads:[~2021-10-26  9:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211022193538.GA98810@troutmask.apl.washington.edu>
     [not found] ` <fae18511-4380-d3f8-bf1a-9384ab279fc5@gmx.de>
     [not found]   ` <20211022202523.GA55664@troutmask.apl.washington.edu>
2021-10-24 19:00     ` Harald Anlauf
2021-10-24 19:04       ` Steve Kargl
2021-10-26  9:55       ` Tobias Burnus [this message]
2021-10-26 12: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=9493b683-a21f-c9c5-6c53-947c1dd20e09@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sgk@troutmask.apl.washington.edu \
    /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).