* [Patch, fortran] PR83515, PR85797 - ICE in gfc_element_size
@ 2019-03-20 22:20 Harald Anlauf
2019-03-27 19:34 ` [Ping] " Harald Anlauf
2019-03-31 19:33 ` Harald Anlauf
0 siblings, 2 replies; 4+ messages in thread
From: Harald Anlauf @ 2019-03-20 22:20 UTC (permalink / raw)
To: gfortran, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 690 bytes --]
The PRs originated in gfc_element_size lacking a treatment of
procedure pointers, which has been added. The testcase is currently
a pure compile test. When a reduced run-time test for PR83515
becomes available, it will be added to the testsuite.
Regtested on x86_64-pc-linux-gnu.
OK for trunk?
Thanks,
Harald
2019-03-20 Harald Anlauf <anlauf@gmx.de>
PR fortran/83515
PR fortran/85797
* trans-types.c (gfc_typenode_for_spec): Handle conversion for
procedure pointers.
* target-memory.c (gfc_element_size): Handle size determination
for procedure pointers.
2019-03-20 Harald Anlauf <anlauf@gmx.de>
PR fortran/83515
PR fortran/85797
* gfortran.dg/pr85797.f90: New test.
[-- Attachment #2: patch-pr85797-pr83515 --]
[-- Type: text/plain, Size: 795 bytes --]
Index: gcc/fortran/target-memory.c
===================================================================
--- gcc/fortran/target-memory.c (revision 269826)
+++ gcc/fortran/target-memory.c (working copy)
@@ -120,6 +120,7 @@
case BT_CLASS:
case BT_VOID:
case BT_ASSUMED:
+ case BT_PROCEDURE:
{
/* Determine type size without clobbering the typespec for ISO C
binding types. */
Index: gcc/fortran/trans-types.c
===================================================================
--- gcc/fortran/trans-types.c (revision 269826)
+++ gcc/fortran/trans-types.c (working copy)
@@ -1194,6 +1194,9 @@
basetype = pfunc_type_node;
}
break;
+ case BT_PROCEDURE:
+ basetype = pfunc_type_node;
+ break;
default:
gcc_unreachable ();
}
[-- Attachment #3: patch-pr85797-testcase --]
[-- Type: text/plain, Size: 1042 bytes --]
Index: gcc/testsuite/gfortran.dg/pr85797.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr85797.f90 (nonexistent)
+++ gcc/testsuite/gfortran.dg/pr85797.f90 (working copy)
@@ -0,0 +1,33 @@
+! { dg-do compile }
+! { dg-options "-Wall" }
+! PR fortran/83515 - ICE: Invalid expression in gfc_element_size
+! PR fortran/85797 - ICE in gfc_element_size, at fortran/target-memory.c:126
+
+subroutine a
+ c = transfer (a, b) ! { dg-warning "Non-RECURSIVE procedure" }
+end
+
+recursive subroutine d
+ c = transfer (d, b)
+end
+
+recursive subroutine e
+ k = transfer (transfer (e, e), 1)
+end
+
+subroutine f
+ use, intrinsic :: iso_c_binding
+ integer(c_intptr_t) :: b, c
+ c = transfer (transfer (b, a), b)
+end
+
+module m
+contains
+ function f () result (z) ! { dg-warning "Return value" }
+ class(*), pointer :: z
+ end function f
+ recursive subroutine s (q)
+ procedure(f) :: q
+ call s (q)
+ end subroutine s
+end
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Ping] [Patch, fortran] PR83515, PR85797 - ICE in gfc_element_size
2019-03-20 22:20 [Patch, fortran] PR83515, PR85797 - ICE in gfc_element_size Harald Anlauf
@ 2019-03-27 19:34 ` Harald Anlauf
2019-03-30 12:16 ` Thomas Koenig
2019-03-31 19:33 ` Harald Anlauf
1 sibling, 1 reply; 4+ messages in thread
From: Harald Anlauf @ 2019-03-27 19:34 UTC (permalink / raw)
To: gfortran, gcc-patches
Ping!?
On 03/20/19 23:20, Harald Anlauf wrote:
> The PRs originated in gfc_element_size lacking a treatment of
> procedure pointers, which has been added. The testcase is currently
> a pure compile test. When a reduced run-time test for PR83515
> becomes available, it will be added to the testsuite.
>
> Regtested on x86_64-pc-linux-gnu.
>
> OK for trunk?
>
> Thanks,
> Harald
>
> 2019-03-20 Harald Anlauf <anlauf@gmx.de>
>
> PR fortran/83515
> PR fortran/85797
> * trans-types.c (gfc_typenode_for_spec): Handle conversion for
> procedure pointers.
> * target-memory.c (gfc_element_size): Handle size determination
> for procedure pointers.
>
> 2019-03-20 Harald Anlauf <anlauf@gmx.de>
>
> PR fortran/83515
> PR fortran/85797
> * gfortran.dg/pr85797.f90: New test.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Ping] [Patch, fortran] PR83515, PR85797 - ICE in gfc_element_size
2019-03-27 19:34 ` [Ping] " Harald Anlauf
@ 2019-03-30 12:16 ` Thomas Koenig
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Koenig @ 2019-03-30 12:16 UTC (permalink / raw)
To: fortran
Hi Harald,
> Ping!?
OK (and also highly unlikely to cause regressions), so OK
for current trunk.
Thanks!
Regards
Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch, fortran] PR83515, PR85797 - ICE in gfc_element_size
2019-03-20 22:20 [Patch, fortran] PR83515, PR85797 - ICE in gfc_element_size Harald Anlauf
2019-03-27 19:34 ` [Ping] " Harald Anlauf
@ 2019-03-31 19:33 ` Harald Anlauf
1 sibling, 0 replies; 4+ messages in thread
From: Harald Anlauf @ 2019-03-31 19:33 UTC (permalink / raw)
To: gfortran, gcc-patches
Committed to trunk as svn rev. 270045.
Since the patch is considered safe, I also committed to open branches (7/8).
Thanks for the review!
Harald
On 03/20/19 23:20, Harald Anlauf wrote:
> The PRs originated in gfc_element_size lacking a treatment of
> procedure pointers, which has been added. The testcase is currently
> a pure compile test. When a reduced run-time test for PR83515
> becomes available, it will be added to the testsuite.
>
> Regtested on x86_64-pc-linux-gnu.
>
> OK for trunk?
>
> Thanks,
> Harald
>
> 2019-03-20 Harald Anlauf <anlauf@gmx.de>
>
> PR fortran/83515
> PR fortran/85797
> * trans-types.c (gfc_typenode_for_spec): Handle conversion for
> procedure pointers.
> * target-memory.c (gfc_element_size): Handle size determination
> for procedure pointers.
>
> 2019-03-20 Harald Anlauf <anlauf@gmx.de>
>
> PR fortran/83515
> PR fortran/85797
> * gfortran.dg/pr85797.f90: New test.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-03-31 19:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20 22:20 [Patch, fortran] PR83515, PR85797 - ICE in gfc_element_size Harald Anlauf
2019-03-27 19:34 ` [Ping] " Harald Anlauf
2019-03-30 12:16 ` Thomas Koenig
2019-03-31 19:33 ` Harald Anlauf
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).