public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <mikael@gcc.gnu.org>
To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [PATCH v3 1/5] fortran: Tiny sort_actual internal refactoring
Date: Sun,  7 Nov 2021 17:16:32 +0100	[thread overview]
Message-ID: <20211107161636.1167116-2-mikael@gcc.gnu.org> (raw)
In-Reply-To: <20211107161636.1167116-1-mikael@gcc.gnu.org>

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


Preliminary refactoring to make further changes more obvious.
No functional change.

gcc/fortran/ChangeLog:
	* intrinsic.c (sort_actual): initialise variable and use it earlier.
---
 gcc/fortran/intrinsic.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-fortran-Tiny-sort_actual-internal-refactoring.patch --]
[-- Type: text/x-patch; name="0001-fortran-Tiny-sort_actual-internal-refactoring.patch", Size: 666 bytes --]

diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index a6a18a471e3..49ef3b2a3d2 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -4378,19 +4378,18 @@ do_sort:
 
   for (f = formal; f; f = f->next)
     {
-      if (f->actual && f->actual->label != NULL && f->ts.type)
+      a = f->actual;
+      if (a && a->label != NULL && f->ts.type)
 	{
 	  gfc_error ("ALTERNATE RETURN not permitted at %L", where);
 	  return false;
 	}
 
-      if (f->actual == NULL)
+      if (a == NULL)
 	{
 	  a = gfc_get_actual_arglist ();
 	  a->missing_arg_type = f->ts.type;
 	}
-      else
-	a = f->actual;
 
       if (actual == NULL)
 	*ap = a;

  reply	other threads:[~2021-11-07 16:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-07 16:16 [PATCH v3 0/5] fortran: Ignore unused arguments for scalarisation [PR97896] Mikael Morin
2021-11-07 16:16 ` Mikael Morin [this message]
2021-11-07 16:16 ` [PATCH v3 2/5] fortran: Reverse actual vs dummy argument mapping Mikael Morin
2021-11-07 16:16 ` [PATCH v3 3/5] fortran: simplify elemental arguments walking Mikael Morin
2021-11-07 16:16 ` [PATCH v3 4/5] fortran: Delete redundant missing_arg_type field Mikael Morin
2021-11-07 16:16 ` [PATCH v3 5/5] fortran: Identify arguments by their names Mikael Morin
2021-11-11 18:32 ` [PATCH v3 0/5] fortran: Ignore unused arguments for scalarisation [PR97896] Thomas Koenig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211107161636.1167116-2-mikael@gcc.gnu.org \
    --to=mikael@gcc.gnu.org \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).