[PATCH] PR fortran/56985 - gcc/fortran/resolve.c:920: "'%s' in cannot appear in COMMON ..."

2021-08-31 Thread Harald Anlauf via Fortran
I intend to commit the fix to the error message using the patch below
within the next 24h unless there are objections or better suggestions.

The unchanged part of the error message is already covered by
gcc/testsuite/gfortran.dg/unlimited_polymorphic_2.f03 and does
not need to be adapted.

Thanks,
Harald


Fortran - improve wording of error message

gcc/fortran/ChangeLog:

PR fortran/56985
* resolve.c (resolve_common_vars): Fix grammar and improve wording
of error message rejecting an unlimited polymorphic in COMMON.

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index f641d0d4dae..8e5ed1c032c 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -979,7 +979,7 @@ resolve_common_vars (gfc_common_head *common_block, bool named_common)
 	}

   if (UNLIMITED_POLY (csym))
-	gfc_error_now ("%qs in cannot appear in COMMON at %L "
+	gfc_error_now ("%qs at %L cannot appear in COMMON "
 		   "[F2008:C5100]", csym->name, &csym->declared_at);

   if (csym->ts.type != BT_DERIVED)


*PING* [PATCH] PR fortran/93834 - [9/10/11/12 Regression] ICE in trans_caf_is_present, at fortran/trans-intrinsic.c:8469

2021-08-31 Thread Harald Anlauf via Fortran
PING!

> Gesendet: Dienstag, 24. August 2021 um 22:36 Uhr
> Von: "Harald Anlauf" 
> An: "fortran" , "gcc-patches" 
> Betreff: [PATCH] PR fortran/93834 - [9/10/11/12 Regression] ICE in 
> trans_caf_is_present, at fortran/trans-intrinsic.c:8469
>
> Dear Fortranners,
>
> here's a pretty obvious one: we didn't properly check the arguments
> for intrinsics when these had to be ALLOCATABLE and in the case that
> argument was a coarray object.  Simple solution: just reuse a check
> that was used for pointer etc.
>
> Regtested on x86_64-pc-linux-gnu.  OK for mainline / backports?
>
> Thanks,
> Harald
>
>
> Fortran - extend allocatable_check to coarrays
>
> gcc/fortran/ChangeLog:
>
>   PR fortran/93834
>   * check.c (allocatable_check): A coindexed array element is not an
>   allocatable object.
>
> gcc/testsuite/ChangeLog:
>
>   PR fortran/93834
>   * gfortran.dg/coarray_allocated.f90: New test.
>
>