public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fortran : Bogus error with additional blanks in type(*) PR95829
@ 2020-06-24  8:12 Mark Eggleston
  2020-06-24  9:13 ` Manfred Schwarb
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Eggleston @ 2020-06-24  8:12 UTC (permalink / raw)
  To: gcc-patches, fortran

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

Please find a fix for PR95829.  Original patch by Steve Kargl posted to PR.

Commit to master and backport?

Commit message:

Fortran  : Bogus error with additional blanks in type(*) PR95829

Checking for "* ) " instead of "*)" clears the bogus error.

2020-06-24  Steven G. Kargl  <kargl@gcc.gnu.org>

gcc/fortran/

     PR fortran/95829
     * decl.c (gfc_match_decl_type_spec): Compare with "* ) " instead
     of "*)".

2020-06-24  Mark Eggleston <markeggleston@gcc.gnu.org>

gcc/testsuite/

     PR fortran/95829
     * gfortran.dg/pr95829.f90: New test.

-- 
https://www.codethink.co.uk/privacy.html


[-- Attachment #2: 0001-Fortran-Bogus-error-with-additional-blanks-in-type-P.patch --]
[-- Type: text/x-patch, Size: 1749 bytes --]

From 1da0ff935d819e7bdbac5219ccb7b30d70c6e87c Mon Sep 17 00:00:00 2001
From: Mark Eggleston <markeggleston@gcc.gnu.org>
Date: Tue, 23 Jun 2020 11:01:28 +0100
Subject: [PATCH] Fortran  : Bogus error with additional blanks in type(*)
 PR95829

Checking for "* ) " instead of "*)" clears the bogus error.

2020-06-24  Steven G. Kargl  <kargl@gcc.gnu.org>

gcc/fortran/

	PR fortran/95829
	* decl.c (gfc_match_decl_type_spec): Compare with "* ) " instead
	of "*)".

2020-06-24  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/testsuite/

	PR fortran/95829
	* gfortran.dg/pr95829.f90: New test.
---
 gcc/fortran/decl.c                    |  2 +-
 gcc/testsuite/gfortran.dg/pr95829.f90 | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gfortran.dg/pr95829.f90

diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index c27cfacf2e4..0659cae3175 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -4128,7 +4128,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
       gfc_gobble_whitespace ();
       if (gfc_peek_ascii_char () == '*')
 	{
-	  if ((m = gfc_match ("*)")) != MATCH_YES)
+	  if ((m = gfc_match ("* ) ")) != MATCH_YES)
 	    return m;
 	  if (gfc_comp_struct (gfc_current_state ()))
 	    {
diff --git a/gcc/testsuite/gfortran.dg/pr95829.f90 b/gcc/testsuite/gfortran.dg/pr95829.f90
new file mode 100644
index 00000000000..9ac3c1d5344
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95829.f90
@@ -0,0 +1,14 @@
+! {dg-do compile }
+!
+! Declaration of b used to be a bogus failure.
+
+subroutine s (a, b, c, d, e, f, g)
+  type(*) :: a
+  type(* ) :: b
+  type( *) :: c
+  type( * ) :: d
+  type(*  ) :: e
+  type(  *) :: f
+  type(  *  ) :: g
+end
+
-- 
2.11.0


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

* Re: [PATCH] Fortran : Bogus error with additional blanks in type(*) PR95829
  2020-06-24  8:12 [PATCH] Fortran : Bogus error with additional blanks in type(*) PR95829 Mark Eggleston
@ 2020-06-24  9:13 ` Manfred Schwarb
  2020-06-30 12:56   ` Mark Eggleston
  0 siblings, 1 reply; 4+ messages in thread
From: Manfred Schwarb @ 2020-06-24  9:13 UTC (permalink / raw)
  To: Mark Eggleston, gcc-patches, fortran

Am 24.06.20 um 10:12 schrieb Mark Eggleston:
> Please find a fix for PR95829.  Original patch by Steve Kargl posted to PR.
>
> Commit to master and backport?
>
> Commit message:
>
> Fortran  : Bogus error with additional blanks in type(*) PR95829
>
> Checking for "* ) " instead of "*)" clears the bogus error.
>
> 2020-06-24  Steven G. Kargl  <kargl@gcc.gnu.org>
>
> gcc/fortran/
>
>     PR fortran/95829
>     * decl.c (gfc_match_decl_type_spec): Compare with "* ) " instead
>     of "*)".
>
> 2020-06-24  Mark Eggleston <markeggleston@gcc.gnu.org>
>
> gcc/testsuite/
>
>     PR fortran/95829
>     * gfortran.dg/pr95829.f90: New test.
>

@@ -0,0 +1,14 @@
+! {dg-do compile }
+!
+! Declaration of b used to be a bogus failure.

{ dg-do compile }

with surrounding spaces, otherwise this dg-directive will not be recognized.

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

* Re: [PATCH] Fortran : Bogus error with additional blanks in type(*) PR95829
  2020-06-24  9:13 ` Manfred Schwarb
@ 2020-06-30 12:56   ` Mark Eggleston
  2020-06-30 13:48     ` Thomas Koenig
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Eggleston @ 2020-06-30 12:56 UTC (permalink / raw)
  To: Manfred Schwarb, gcc-patches, fortran

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

On 24/06/2020 10:13, Manfred Schwarb wrote:
> Am 24.06.20 um 10:12 schrieb Mark Eggleston:
>> Please find a fix for PR95829.  Original patch by Steve Kargl posted to PR.
>>
>> Commit to master and backport?
>>
>> Commit message:
>>
>> Fortran  : Bogus error with additional blanks in type(*) PR95829
>>
>> Checking for "* ) " instead of "*)" clears the bogus error.
>>
>> 2020-06-24  Steven G. Kargl  <kargl@gcc.gnu.org>
>>
>> gcc/fortran/
>>
>>      PR fortran/95829
>>      * decl.c (gfc_match_decl_type_spec): Compare with "* ) " instead
>>      of "*)".
>>
>> 2020-06-24  Mark Eggleston <markeggleston@gcc.gnu.org>
>>
>> gcc/testsuite/
>>
>>      PR fortran/95829
>>      * gfortran.dg/pr95829.f90: New test.
>>
> @@ -0,0 +1,14 @@
> +! {dg-do compile }
> +!
> +! Declaration of b used to be a bogus failure.
>
> { dg-do compile }
>
> with surrounding spaces, otherwise this dg-directive will not be recognized.
>
Fixed the test case, the new patch is attached.

OK for commit to master and backports?

Updated commit message:

Fortran  : Bogus error with additional blanks in type(*) PR95829

Checking for "* ) " instead of "*)" clears the bogus error.

2020-06-30  Steven G. Kargl  <kargl@gcc.gnu.org>

gcc/fortran/

     PR fortran/95829
     * decl.c (gfc_match_decl_type_spec): Compare with "* ) " instead
     of "*)".

2020-06-30  Mark Eggleston <markeggleston@gcc.gnu.org>

gcc/testsuite/

     PR fortran/95829
     * gfortran.dg/pr95829.f90: New test.

-- 
https://www.codethink.co.uk/privacy.html


[-- Attachment #2: 0001-PR95829.patch --]
[-- Type: text/x-patch, Size: 1750 bytes --]

From 0dd0b086f64d295a4373ce4cf495f85de2d95b1f Mon Sep 17 00:00:00 2001
From: Mark Eggleston <markeggleston@gcc.gnu.org>
Date: Tue, 23 Jun 2020 11:01:28 +0100
Subject: [PATCH] Fortran  : Bogus error with additional blanks in type(*)
 PR95829

Checking for "* ) " instead of "*)" clears the bogus error.

2020-06-24  Steven G. Kargl  <kargl@gcc.gnu.org>

gcc/fortran/

	PR fortran/95829
	* decl.c (gfc_match_decl_type_spec): Compare with "* ) " instead
	of "*)".

2020-06-24  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/testsuite/

	PR fortran/95829
	* gfortran.dg/pr95829.f90: New test.
---
 gcc/fortran/decl.c                    |  2 +-
 gcc/testsuite/gfortran.dg/pr95829.f90 | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gfortran.dg/pr95829.f90

diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index ac1f63f66e0..3bc5881e0ce 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -4128,7 +4128,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
       gfc_gobble_whitespace ();
       if (gfc_peek_ascii_char () == '*')
 	{
-	  if ((m = gfc_match ("*)")) != MATCH_YES)
+	  if ((m = gfc_match ("* ) ")) != MATCH_YES)
 	    return m;
 	  if (gfc_comp_struct (gfc_current_state ()))
 	    {
diff --git a/gcc/testsuite/gfortran.dg/pr95829.f90 b/gcc/testsuite/gfortran.dg/pr95829.f90
new file mode 100644
index 00000000000..081d647c7c0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95829.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+!
+! Declaration of b used to be a bogus failure.
+
+subroutine s (a, b, c, d, e, f, g)
+  type(*) :: a
+  type(* ) :: b
+  type( *) :: c
+  type( * ) :: d
+  type(*  ) :: e
+  type(  *) :: f
+  type(  *  ) :: g
+end
+
-- 
2.11.0


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

* Re: [PATCH] Fortran : Bogus error with additional blanks in type(*) PR95829
  2020-06-30 12:56   ` Mark Eggleston
@ 2020-06-30 13:48     ` Thomas Koenig
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Koenig @ 2020-06-30 13:48 UTC (permalink / raw)
  To: Mark Eggleston, Manfred Schwarb, gcc-patches, fortran

Hi Mark,

> Fixed the test case, the new patch is attached.
> 
> OK for commit to master and backports?

OK.

Thanks a lot!

Regards

	Thomas

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

end of thread, other threads:[~2020-06-30 13:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24  8:12 [PATCH] Fortran : Bogus error with additional blanks in type(*) PR95829 Mark Eggleston
2020-06-24  9:13 ` Manfred Schwarb
2020-06-30 12:56   ` Mark Eggleston
2020-06-30 13:48     ` Thomas Koenig

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