* [Fortran, Patch} Fix ICE for coarray Critical inside module procedure
@ 2015-12-10 15:37 Alessandro Fanfarillo
2015-12-14 19:02 ` Tobias Burnus
0 siblings, 1 reply; 3+ messages in thread
From: Alessandro Fanfarillo @ 2015-12-10 15:37 UTC (permalink / raw)
To: gfortran, gcc-patches, opencoarrays
[-- Attachment #1: Type: text/plain, Size: 482 bytes --]
Dear all,
the compiler returns an ICE when a coarray critical section is used
inside a module procedure.
The symbols related with the lock variables were left uncommitted
inside resolve_critical(). A gfc_commit_symbol after each symbol or a
gfc_commit_symbols at the end of resolve_critical() fixed the issue.
The latter solution is proposed in the attached patch.
Built and regtested on x86_64-pc-linux-gnu
Cheers
Alessandro
PS: This patch should be also included in GCC 5.
[-- Attachment #2: critical.diff --]
[-- Type: text/plain, Size: 1259 bytes --]
2015-12-10 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
* resolve.c (resolve_critical): Committing symbols of
lock variables.
2015-12-10 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
* gfortran.dg/coarray_critical_1.f90: New.
commit ccc06accb4891ab95d33135b62c479d895b2270f
Author: Alessandro Fanfarillo <fanfarillo@ing.uniroma2.it>
Date: Thu Dec 10 15:28:33 2015 +0000
Committing symbols of lock variables inside resolve_critical()
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 65a2b7f..3988b3c 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -8852,6 +8852,7 @@ resolve_critical (gfc_code *code)
symtree->n.sym->as->cotype = AS_EXPLICIT;
symtree->n.sym->as->lower[0] = gfc_get_int_expr (gfc_default_integer_kind,
NULL, 1);
+ gfc_commit_symbols();
}
diff --git a/gcc/testsuite/gfortran.dg/coarray_critical_1.f90 b/gcc/testsuite/gfortran.dg/coarray_critical_1.f90
new file mode 100644
index 0000000..4d93bf6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/coarray_critical_1.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib" }
+!
+
+module m
+ contains
+ subroutine f()
+ critical
+ end critical
+ end subroutine f
+ end module m
+end program
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Fortran, Patch} Fix ICE for coarray Critical inside module procedure
2015-12-10 15:37 [Fortran, Patch} Fix ICE for coarray Critical inside module procedure Alessandro Fanfarillo
@ 2015-12-14 19:02 ` Tobias Burnus
2015-12-15 13:28 ` Alessandro Fanfarillo
0 siblings, 1 reply; 3+ messages in thread
From: Tobias Burnus @ 2015-12-14 19:02 UTC (permalink / raw)
To: Alessandro Fanfarillo, gfortran, gcc-patches, opencoarrays
Dear Alessandro,
Alessandro Fanfarillo wrote:
> the compiler returns an ICE when a coarray critical section is used
> inside a module procedure.
> The symbols related with the lock variables were left uncommitted
> inside resolve_critical(). A gfc_commit_symbol after each symbol or a
> gfc_commit_symbols at the end of resolve_critical() fixed the issue.
>
> The latter solution is proposed in the attached patch.
> Built and regtested on x86_64-pc-linux-gnu
Looks good to me.
> PS: This patch should be also included in GCC 5.
Yes, that's fine with me.
Tobias
PS: I saw that you now have a GCC account, which you can use to commit
to both the trunk and gcc-5-branch. See https://gcc.gnu.org/svnwrite.html.
Additionally, you should update MAINTAINERS (trunk only) by adding
yourself under "Write After Approval"; you can simply commit this patch
yourself, but you should write an email to gcc-patches with the patch -
like Alan did at https://gcc.gnu.org/ml/gcc-patches/2015-10/msg02390.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Fortran, Patch} Fix ICE for coarray Critical inside module procedure
2015-12-14 19:02 ` Tobias Burnus
@ 2015-12-15 13:28 ` Alessandro Fanfarillo
0 siblings, 0 replies; 3+ messages in thread
From: Alessandro Fanfarillo @ 2015-12-15 13:28 UTC (permalink / raw)
To: Tobias Burnus; +Cc: gfortran, gcc-patches, opencoarrays
Committed as revision 231649 on trunk and as revision 231650 on gcc-5-branch.
Thanks.
2015-12-14 20:02 GMT+01:00 Tobias Burnus <burnus@net-b.de>:
> Dear Alessandro,
>
> Alessandro Fanfarillo wrote:
>>
>> the compiler returns an ICE when a coarray critical section is used
>> inside a module procedure.
>> The symbols related with the lock variables were left uncommitted
>> inside resolve_critical(). A gfc_commit_symbol after each symbol or a
>> gfc_commit_symbols at the end of resolve_critical() fixed the issue.
>>
>> The latter solution is proposed in the attached patch.
>> Built and regtested on x86_64-pc-linux-gnu
>
>
> Looks good to me.
>
>> PS: This patch should be also included in GCC 5.
>
>
> Yes, that's fine with me.
>
> Tobias
>
> PS: I saw that you now have a GCC account, which you can use to commit to
> both the trunk and gcc-5-branch. See https://gcc.gnu.org/svnwrite.html.
> Additionally, you should update MAINTAINERS (trunk only) by adding yourself
> under "Write After Approval"; you can simply commit this patch yourself, but
> you should write an email to gcc-patches with the patch - like Alan did at
> https://gcc.gnu.org/ml/gcc-patches/2015-10/msg02390.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-12-15 13:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 15:37 [Fortran, Patch} Fix ICE for coarray Critical inside module procedure Alessandro Fanfarillo
2015-12-14 19:02 ` Tobias Burnus
2015-12-15 13:28 ` Alessandro Fanfarillo
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).