public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, 10 Regression] FAIL: gfortran.dg/pr93365.f90 PR94386
@ 2020-04-01  9:31 Mark Eggleston
  2020-04-01  9:43 ` H.J. Lu
  2020-04-01  9:50 ` Tobias Burnus
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Eggleston @ 2020-04-01  9:31 UTC (permalink / raw)
  To: fortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]

Please find attached a patch to fix test case failures of pr93365.f90, 
pr93600_1.f90 and pr93600_2.f90.

OK to commit?

gcc/fortran/ChangeLog:

     Mark Eggleston  <mark.eggleston@codethink.com>

     PR fortran/04386
     expr.c (simplify_parameter_variable):  Restore code deleted
     in PR94246.

-- 
https://www.codethink.co.uk/privacy.html


[-- Attachment #2: 0001-fortran-10-Regression-FAIL-gfortran.dg-pr93365.f90-P.patch --]
[-- Type: text/x-patch, Size: 2228 bytes --]

From 0825e19558b2243a3300fc4d468665cd6adecbe3 Mon Sep 17 00:00:00 2001
From: Mark Eggleston <markeggleston@gcc.gnu.org>
Date: Tue, 31 Mar 2020 15:54:10 +0100
Subject: [PATCH] fortran :  [10 Regression] FAIL: gfortran.dg/pr93365.f90
 PR94386

Failures of pr93365.f90,  pr93600_1.f90 and pr93600_2.f90.
Changes made by PR94246 delete and changed code from expr.c
introduced by PR93600, the deleted code.  This broke the PR93600
test cases.  Restoring the deleted code and leaving the changed
code alone allows the cases for PR93600 and PR94246 to pass.

gcc/fortran/ChangeLog:

	PR fortran/04386
	expr.c (simplify_parameter_variable):  Restore code deleted
	in PR94246.
---
 gcc/fortran/expr.c | 33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 1106341df91..a9fa03ad153 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -2057,6 +2057,18 @@ simplify_parameter_variable (gfc_expr *p, int type)
     }
   gfc_expression_rank (p);
 
+  /* Is this an inquiry?  */
+  bool inquiry = false;
+  gfc_ref* ref = p->ref;
+  while (ref)
+    {
+      if (ref->type == REF_INQUIRY)
+	break;
+      ref = ref->next;
+    }
+  if (ref && ref->type == REF_INQUIRY)
+    inquiry = ref->u.i == INQUIRY_LEN || ref->u.i == INQUIRY_KIND;
+
   if (gfc_is_size_zero_array (p))
     {
       if (p->expr_type == EXPR_ARRAY)
@@ -2069,15 +2081,22 @@ simplify_parameter_variable (gfc_expr *p, int type)
       e->value.constructor = NULL;
       e->shape = gfc_copy_shape (p->shape, p->rank);
       e->where = p->where;
-      gfc_replace_expr (p, e);
-      return true;
+      /* If %kind and %len are not used then we're done, otherwise
+	 drop through for simplification.  */
+      if (!inquiry)
+	{
+	  gfc_replace_expr (p, e);
+	  return true;
+	}
     }
+  else
+    {
+      e = gfc_copy_expr (p->symtree->n.sym->value);
+      if (e == NULL)
+	return false;
 
-  e = gfc_copy_expr (p->symtree->n.sym->value);
-  if (e == NULL)
-    return false;
-
-  e->rank = p->rank;
+      e->rank = p->rank;
+    }
 
   if (e->ts.type == BT_CHARACTER && e->ts.u.cl == NULL)
     e->ts.u.cl = gfc_new_charlen (gfc_current_ns, p->ts.u.cl);
-- 
2.11.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch, 10 Regression] FAIL: gfortran.dg/pr93365.f90 PR94386
  2020-04-01  9:31 [patch, 10 Regression] FAIL: gfortran.dg/pr93365.f90 PR94386 Mark Eggleston
@ 2020-04-01  9:43 ` H.J. Lu
  2020-04-01  9:46   ` Jakub Jelinek
  2020-04-01  9:46   ` Mark Eggleston
  2020-04-01  9:50 ` Tobias Burnus
  1 sibling, 2 replies; 6+ messages in thread
From: H.J. Lu @ 2020-04-01  9:43 UTC (permalink / raw)
  To: Mark Eggleston; +Cc: fortran, gcc-patches

On Wed, Apr 1, 2020 at 2:31 AM Mark Eggleston
<mark.eggleston@codethink.co.uk> wrote:
>
> Please find attached a patch to fix test case failures of pr93365.f90,
> pr93600_1.f90 and pr93600_2.f90.
>
> OK to commit?
>
> gcc/fortran/ChangeLog:
>
>      Mark Eggleston  <mark.eggleston@codethink.com>
>
>      PR fortran/04386
                         ^^^^^^^ Wrong PR #.
>      expr.c (simplify_parameter_variable):  Restore code deleted
>      in PR94246.
>
> --
> https://www.codethink.co.uk/privacy.html
>


-- 
H.J.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch, 10 Regression] FAIL: gfortran.dg/pr93365.f90 PR94386
  2020-04-01  9:43 ` H.J. Lu
@ 2020-04-01  9:46   ` Jakub Jelinek
  2020-04-01  9:50     ` Mark Eggleston
  2020-04-01  9:46   ` Mark Eggleston
  1 sibling, 1 reply; 6+ messages in thread
From: Jakub Jelinek @ 2020-04-01  9:46 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Mark Eggleston, gcc-patches, fortran

On Wed, Apr 01, 2020 at 02:43:46AM -0700, H.J. Lu via Gcc-patches wrote:
> On Wed, Apr 1, 2020 at 2:31 AM Mark Eggleston
> <mark.eggleston@codethink.co.uk> wrote:
> >
> > Please find attached a patch to fix test case failures of pr93365.f90,
> > pr93600_1.f90 and pr93600_2.f90.
> >
> > OK to commit?
> >
> > gcc/fortran/ChangeLog:
> >
> >      Mark Eggleston  <mark.eggleston@codethink.com>
> >
> >      PR fortran/04386
>                          ^^^^^^^ Wrong PR #.
> >      expr.c (simplify_parameter_variable):  Restore code deleted

And just one space after :, not two.

> >      in PR94246.

	Jakub


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch, 10 Regression] FAIL: gfortran.dg/pr93365.f90 PR94386
  2020-04-01  9:43 ` H.J. Lu
  2020-04-01  9:46   ` Jakub Jelinek
@ 2020-04-01  9:46   ` Mark Eggleston
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Eggleston @ 2020-04-01  9:46 UTC (permalink / raw)
  To: H.J. Lu; +Cc: fortran, gcc-patches


On 01/04/2020 10:43, H.J. Lu wrote:
> On Wed, Apr 1, 2020 at 2:31 AM Mark Eggleston
> <mark.eggleston@codethink.co.uk> wrote:
>> Please find attached a patch to fix test case failures of pr93365.f90,
>> pr93600_1.f90 and pr93600_2.f90.
>>
>> OK to commit?
>>
>> gcc/fortran/ChangeLog:
>>
>>       Mark Eggleston  <mark.eggleston@codethink.com>
>>
>>       PR fortran/04386
>                           ^^^^^^^ Wrong PR #.
Fixed, thanks.
>>       expr.c (simplify_parameter_variable):  Restore code deleted
>>       in PR94246.
>>
>> --
>> https://www.codethink.co.uk/privacy.html
>>
>
-- 
https://www.codethink.co.uk/privacy.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch, 10 Regression] FAIL: gfortran.dg/pr93365.f90 PR94386
  2020-04-01  9:31 [patch, 10 Regression] FAIL: gfortran.dg/pr93365.f90 PR94386 Mark Eggleston
  2020-04-01  9:43 ` H.J. Lu
@ 2020-04-01  9:50 ` Tobias Burnus
  1 sibling, 0 replies; 6+ messages in thread
From: Tobias Burnus @ 2020-04-01  9:50 UTC (permalink / raw)
  To: Mark Eggleston, fortran, gcc-patches

LGTM with the PR/spacing fixed as noted by HJ and Jakub.

Thanks for the patch!

Tobias

On 4/1/20 11:31 AM, Mark Eggleston wrote:
> Please find attached a patch to fix test case failures of pr93365.f90,
> pr93600_1.f90 and pr93600_2.f90.
>
> OK to commit?
>
> gcc/fortran/ChangeLog:
>
>     Mark Eggleston  <mark.eggleston@codethink.com>
>
>     PR fortran/04386
>     expr.c (simplify_parameter_variable):  Restore code deleted
>     in PR94246.
>
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch, 10 Regression] FAIL: gfortran.dg/pr93365.f90 PR94386
  2020-04-01  9:46   ` Jakub Jelinek
@ 2020-04-01  9:50     ` Mark Eggleston
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Eggleston @ 2020-04-01  9:50 UTC (permalink / raw)
  To: Jakub Jelinek, H.J. Lu; +Cc: gcc-patches, fortran


On 01/04/2020 10:46, Jakub Jelinek wrote:
> On Wed, Apr 01, 2020 at 02:43:46AM -0700, H.J. Lu via Gcc-patches wrote:
>> On Wed, Apr 1, 2020 at 2:31 AM Mark Eggleston
>> <mark.eggleston@codethink.co.uk> wrote:
>>> Please find attached a patch to fix test case failures of pr93365.f90,
>>> pr93600_1.f90 and pr93600_2.f90.
>>>
>>> OK to commit?
>>>
>>> gcc/fortran/ChangeLog:
>>>
>>>       Mark Eggleston  <mark.eggleston@codethink.com>
>>>
>>>       PR fortran/04386
>>                           ^^^^^^^ Wrong PR #.
>>>       expr.c (simplify_parameter_variable):  Restore code deleted
> And just one space after :, not two.
OK.
>
>>>       in PR94246.
> 	Jakub
>
>
-- 
https://www.codethink.co.uk/privacy.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-01  9:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01  9:31 [patch, 10 Regression] FAIL: gfortran.dg/pr93365.f90 PR94386 Mark Eggleston
2020-04-01  9:43 ` H.J. Lu
2020-04-01  9:46   ` Jakub Jelinek
2020-04-01  9:50     ` Mark Eggleston
2020-04-01  9:46   ` Mark Eggleston
2020-04-01  9:50 ` Tobias Burnus

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).