diff mbox

[Fortran,OOP] PR 78443: Incorrect behavior with non_overridable keyword

Message ID CAKwh3qiSRPJzw=T+AuiWpoGc6cTwQfK-m8v58k55WAwhOoFswg@mail.gmail.com
State New
Headers show

Commit Message

Janus Weil Nov. 22, 2016, 12:14 p.m. UTC
Hi all,

here is a patch for a wrong-code problem with non_overridable
type-bound procedures. For details see the PR. Regtests cleanly. Ok
for trunk?

Since the patch is very simple and it fixes wrong code which can
silently give bad runtime results, I think backporting to the release
branches might be a good idea as well. Ok?

Cheers,
Janus


2016-11-22  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/78443
    * class.c (add_proc_comp): Add a vtype component for non-overridable
    procedures that are overriding.

2016-11-22  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/78443
    * gfortran.dg/typebound_proc_35.f90: New test case.

Comments

Steve Kargl Nov. 22, 2016, 3:16 p.m. UTC | #1
On Tue, Nov 22, 2016 at 01:14:46PM +0100, Janus Weil wrote:
> 
> here is a patch for a wrong-code problem with non_overridable
> type-bound procedures. For details see the PR. Regtests cleanly. Ok
> for trunk?

OK.

> Since the patch is very simple and it fixes wrong code which can
> silently give bad runtime results, I think backporting to the release
> branches might be a good idea as well. Ok?

OK.
Janus Weil Nov. 22, 2016, 4:08 p.m. UTC | #2
2016-11-22 16:16 GMT+01:00 Steve Kargl <sgk@troutmask.apl.washington.edu>:
>> here is a patch for a wrong-code problem with non_overridable
>> type-bound procedures. For details see the PR. Regtests cleanly. Ok
>> for trunk?
>
> OK.

Thanks, Steve. Committed as r242703.


>> Since the patch is very simple and it fixes wrong code which can
>> silently give bad runtime results, I think backporting to the release
>> branches might be a good idea as well. Ok?
>
> OK.

Will do soon (within a week or so).

Cheers,
Janus
diff mbox

Patch

Index: gcc/fortran/class.c
===================================================================
--- gcc/fortran/class.c	(Revision 242657)
+++ gcc/fortran/class.c	(Arbeitskopie)
@@ -751,7 +751,7 @@  add_proc_comp (gfc_symbol *vtype, const char *name
 {
   gfc_component *c;
 
-  if (tb->non_overridable)
+  if (tb->non_overridable && !tb->overridden)
     return;
 
   c = gfc_find_component (vtype, name, true, true, NULL);