Commit 69597e2f by Paul Thomas

re PR fortran/87881 (gfortran.dg/inquiry_type_ref_(1.f08|3.f90) fail on darwin)

2018-12-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/87881
	* expr.c (find_inquiry_ref): Loop through the inquiry refs in
	case there are two of them.
	(simplify_ref_chain): Return true after a successful call to
	find_inquiry_ref.

2018-12-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/87881
	* gfortran.dg/inquiry_part_ref_4.f90: New test.

From-SVN: r267337
parent 2f8df14d
2018-12-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/87881
* expr.c (find_inquiry_ref): Loop through the inquiry refs in
case there are two of them.
(simplify_ref_chain): Return true after a successful call to
find_inquiry_ref.
2018-12-19 Steven G. Kargl <kargl@gcc.gnu.org> 2018-12-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/87992 PR fortran/87992
......
...@@ -1730,6 +1730,9 @@ find_inquiry_ref (gfc_expr *p, gfc_expr **newp) ...@@ -1730,6 +1730,9 @@ find_inquiry_ref (gfc_expr *p, gfc_expr **newp)
gfc_resolve_expr (tmp); gfc_resolve_expr (tmp);
/* In principle there can be more than one inquiry reference. */
for (; inquiry; inquiry = inquiry->next)
{
switch (inquiry->u.i) switch (inquiry->u.i)
{ {
case INQUIRY_LEN: case INQUIRY_LEN:
...@@ -1781,6 +1784,8 @@ find_inquiry_ref (gfc_expr *p, gfc_expr **newp) ...@@ -1781,6 +1784,8 @@ find_inquiry_ref (gfc_expr *p, gfc_expr **newp)
mpc_imagref (p->value.complex), GFC_RND_MODE); mpc_imagref (p->value.complex), GFC_RND_MODE);
break; break;
} }
tmp = gfc_copy_expr (*newp);
}
if (!(*newp)) if (!(*newp))
goto cleanup; goto cleanup;
...@@ -1970,7 +1975,7 @@ simplify_ref_chain (gfc_ref *ref, int type, gfc_expr **p) ...@@ -1970,7 +1975,7 @@ simplify_ref_chain (gfc_ref *ref, int type, gfc_expr **p)
gfc_replace_expr (*p, newp); gfc_replace_expr (*p, newp);
gfc_free_ref_list ((*p)->ref); gfc_free_ref_list ((*p)->ref);
(*p)->ref = NULL; (*p)->ref = NULL;
break; return true;;
default: default:
break; break;
......
2018-12-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/87881
* gfortran.dg/inquiry_part_ref_4.f90: New test.
2018-12-21 Andreas Krebbel <krebbel@linux.ibm.com> 2018-12-21 Andreas Krebbel <krebbel@linux.ibm.com>
* gcc.target/s390/vector/fp-signedint-convert-1.c: New test. * gcc.target/s390/vector/fp-signedint-convert-1.c: New test.
......
! { dg-do compile }
! { dg-options "-fdump-tree-original" }
!
! Check the fix for PR87881.
!
complex(8) :: zi = (0,-1_8)
character(2) :: chr ='ab'
if (zi%re%kind .ne. kind (real (zi))) stop 1
if (chr%len%kind .ne. kind (len (chr))) stop 2
! After simplification there should only be the delarations for 'zi' and 'chr'
! { dg-final { scan-tree-dump-times "zi" 1 "original" } }
! { dg-final { scan-tree-dump-times "chr" 1 "original" } }
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