From: Jose E. Marchesi Date: Tue, 9 Dec 2025 22:53:24 +0000 (+0100) Subject: a68: fix `int * char' lowerer X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1769647617c3f523e275cf9a768c3826ac47c634;p=thirdparty%2Fgcc.git a68: fix `int * char' lowerer This commit fixes the asserts in a68_loer_char_mult3 so it expects either int*char or char*int. It also expands the mult-char-1.a68 testcase to cover this case. Signed-off-by: Jose E. Marchesi gcc/algol68/ChangeLog * a68-low-prelude.cc (a68_lower_char_mult3): Fix asserts. gcc/testsuite/ChangeLog * algol68/execute/mult-char-1.a68: Cover int*char cases. --- diff --git a/gcc/algol68/a68-low-prelude.cc b/gcc/algol68/a68-low-prelude.cc index 55c0895bec5..bd54b207fbe 100644 --- a/gcc/algol68/a68-low-prelude.cc +++ b/gcc/algol68/a68-low-prelude.cc @@ -944,7 +944,7 @@ a68_lower_char_mult3 (NODE_T *p, LOW_CTX_T ctx) if (MOID (n1) == M_INT) { - gcc_assert (MOID (n2) == M_STRING || MOID (n2) == M_ROW_CHAR); + gcc_assert (MOID (n2) == M_CHAR); return a68_string_mult (a68_string_from_char (a68_lower_tree (n2, ctx)), a68_lower_tree (n1, ctx)); } diff --git a/gcc/testsuite/algol68/execute/mult-char-1.a68 b/gcc/testsuite/algol68/execute/mult-char-1.a68 index 0e3c1f4b93f..67af07323b4 100644 --- a/gcc/testsuite/algol68/execute/mult-char-1.a68 +++ b/gcc/testsuite/algol68/execute/mult-char-1.a68 @@ -1,5 +1,8 @@ # { dg-options "-fstropping=upper" } # BEGIN ASSERT ("a" * 3 = "aaa"); ASSERT ("" * 1 = ""); - ASSERT ("x" * 0 = "x") + ASSERT ("x" * 0 = "x"); + ASSERT (3 * "a" = "aaa"); + ASSERT (1 * "" = ""); + ASSERT (0 * "x" = "x") END