[RFC] algol68: Remove redundant HAS_ROWS check from caller side of a68_low_dup
Jose E. Marchesi
jemarch@gnu.org
Mon Jun 15 18:40:41 GMT 2026
Hello Kanishka.
The patch looks good to me!
At this point you have to decide whether to contribute to GCC either:
a) Assigning your copyright to the FSF. This involves signing an
electronic PDF. Requires some time to be done, usually weeks.
b) Contributing using the DCO (developer certificate of origin). See
https://gcc.gnu.org/dco.html.
Once you decide, next steps are:
1. You need to add a proper changelog entry to the commit message. Its
presence is checked automatically by a post push git hook, and the
eventual push would be rejected if it is not found. See the GNU
Codying Standards for the changelog format.
In this particular case, you would put something like this in the
commit log (note the tabs):
```
gcc/algol68/ChangeLog
* a68-low-clauses.cc (a68_lower_collateral_clause): Do not check
for rows before calling a68_low_dup.
* a68-low-units.cc (collect_call_arguments): Likewise.
```
Note how the first line identifies the ChangeLog file to use. Once
you commit in your local working tree, you can run the script
./contrib/gcc-changelog/git_check_commit.py HEAD in order to check if
the commit message is ok.
2. Please resend the patch to this list as a [PATCH] with the proper
commit log.
3. Once we make sure the commit log is ok, you will have to send the
patch to gcc-patches@gcc.gnu.org with CC to algol68@gcc.gnu.org.
I will then approve it and push it on your behalf. Once you contribute
regularly, eventually, we can see to get you write permissions to
gcc.git.
Thanks!
> Hi,
>
> As discussed on the mailing list, I worked on the task of removing
> redundant HAS_ROWS checks before calls to a68_low_dup.
>
> This patch removes two caller-side HAS_ROWS checks that are no longer
> necessary, since a68_low_dup now handles the HAS_ROWS case internally.
>
> Tested with:
> make check-algol68
>
> This is my first GCC patch, so feedback is very welcome.
>
> Thanks,
> Kanishka Solanki
> From 76c74eaa4176ff87a06c3dd924fb951282448e03 Mon Sep 17 00:00:00 2001
> From: Kanishka Solanki <kanishkasolanki456s@gmail.com>
> Date: Mon, 15 Jun 2026 20:54:06 +0530
> Subject: [PATCH] remove redundant HAS_ROWS check from caller side of
> a68_low_dup
>
> ---
> gcc/algol68/a68-low-clauses.cc | 1 -
> gcc/algol68/a68-low-units.cc | 1 -
> 2 files changed, 2 deletions(-)
>
> diff --git a/gcc/algol68/a68-low-clauses.cc b/gcc/algol68/a68-low-clauses.cc
> index 9fca4b872bc..f59dbcbb318 100644
> --- a/gcc/algol68/a68-low-clauses.cc
> +++ b/gcc/algol68/a68-low-clauses.cc
> @@ -1132,7 +1132,6 @@ a68_lower_collateral_clause (NODE_T *p ATTRIBUTE_UNUSED,
> for (tree_stmt_iterator si = tsi_start (units); !tsi_end_p (si); tsi_next (&si))
> {
> tree unit = tsi_stmt (si);
> - if (A68_TYPE_HAS_ROWS_P (TREE_TYPE (unit)))
> unit = a68_low_dup (unit);
> CONSTRUCTOR_APPEND_ELT (ve, size_int (num_units), unit);
> num_units += 1;
> diff --git a/gcc/algol68/a68-low-units.cc b/gcc/algol68/a68-low-units.cc
> index f7bfe6f822f..054f7fb3d74 100644
> --- a/gcc/algol68/a68-low-units.cc
> +++ b/gcc/algol68/a68-low-units.cc
> @@ -1133,7 +1133,6 @@ collect_call_arguments (NODE_T *p, vec<tree, va_gc> *args, LOW_CTX_T ctx)
> /* In Algol 68 parameters are passed via an identity declaration, so
> this must implement same semantics. */
> tree arg = a68_lower_tree (p, ctx);
> - if (HAS_ROWS (MOID (p)))
> arg = a68_low_dup (arg);
> arg = a68_consolidate_ref (MOID (p), arg);
> args->quick_push (arg);
More information about the Algol68
mailing list