Commit 9cd74e8f by Steven G. Kargl

re PR fortran/71862 (ICE in gfc_add_component_ref, at fortran/class.c:241)

2016-07-22  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/71862
	* class.c: Remove assert.  Iterate over component only if non-null.

2016-07-22  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/71862
	* gfortran.dg/pr71862.f90: New test.

From-SVN: r238774
parent 0d48446f
2016-07-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71862
* class.c: Remove assert. Iterate over component only if non-null.
2016-07-22 Steven G. Kargl <kargl@gcc.gnu.org> 2016-07-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71935 PR fortran/71935
......
...@@ -238,12 +238,14 @@ gfc_add_component_ref (gfc_expr *e, const char *name) ...@@ -238,12 +238,14 @@ gfc_add_component_ref (gfc_expr *e, const char *name)
/* Avoid losing memory. */ /* Avoid losing memory. */
gfc_free_ref_list (*tail); gfc_free_ref_list (*tail);
c = gfc_find_component (derived, name, true, true, tail); c = gfc_find_component (derived, name, true, true, tail);
gcc_assert (c);
for (ref = *tail; ref->next; ref = ref->next) if (c) {
; for (ref = *tail; ref->next; ref = ref->next)
ref->next = next; ;
if (!next) ref->next = next;
e->ts = c->ts; if (!next)
e->ts = c->ts;
}
} }
......
2016-07-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71862
* gfortran.dg/pr71862.f90: New test.
2016-07-26 Martin Sebor <msebor@redhat.com> 2016-07-26 Martin Sebor <msebor@redhat.com>
* gcc.dg/atomic/pr71675.c: Replace the unsupported c11 target * gcc.dg/atomic/pr71675.c: Replace the unsupported c11 target
......
! { dg-do compile }
program p
type t
integer :: n = 0
integer, pointer :: q => null()
end type
type(t) :: x
print *, associated(x%q)
x = f()
print *, associated(x%q)
contains
function f() result (z) ! { dg-error "must be dummy, allocatable or pointer" }
class(t) :: z
print *, associated(z%q)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment