https://gcc.gnu.org/g:1769647617c3f523e275cf9a768c3826ac47c634

commit r16-6013-g1769647617c3f523e275cf9a768c3826ac47c634
Author: Jose E. Marchesi <[email protected]>
Date:   Tue Dec 9 23:53:24 2025 +0100

    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 <[email protected]>
    
    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:
---
 gcc/algol68/a68-low-prelude.cc                | 2 +-
 gcc/testsuite/algol68/execute/mult-char-1.a68 | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/algol68/a68-low-prelude.cc b/gcc/algol68/a68-low-prelude.cc
index 55c0895bec52..bd54b207fbe2 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 0e3c1f4b93f0..67af07323b4a 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

Reply via email to