[gcc r16-9351] a68: return alias set 0 for Algol 68

"Jose E. Marchesi via Gcc-cvs" <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:739fadbb770cac253918de57391d452a1a3bfe0c

commit r16-9351-g739fadbb770cac253918de57391d452a1a3bfe0c
Author: Kanishka Solanki <[email protected]>
Date:   Mon Jun 22 17:58:40 2026 +0530

    a68: return alias set 0 for Algol 68
    
    Hi,
    
    Following review feedback, this version adds the requested commit
    subject prefix and an explanatory comment before the return statement
    in a68_get_alias_set.
    
    The frontend builds successfully and make check-algol68 passes with this
    change.
    
    Thanks,
    Kanishka Solanki
    [4. text/x-patch; 0001-a68-return-alias-set-0-for-Algol-68.patch]...
    From daf6fde806010dcff462d4078992621646d841ae Mon Sep 17 00:00:00 2001
    From: Kanishka Solanki <[email protected]>
    Date: Sun, 21 Jun 2026 21:34:40 +0530
    Subject: [PATCH] a68: return alias set 0 for Algol 68
    
    The default LANG_HOOKS_GET_ALIAS_SET implementation returns -1,
    causing GCC to use its default alias set machinery.
    
    Override LANG_HOOKS_GET_ALIAS_SET in the Algol 68 frontend and
    return 0 so all objects are treated as potentially aliasing.
    
    gcc/algol68/ChangeLog
    
            * a68-lang.cc (a68_get_alias_set): New function.
            (LANG_HOOKS_GET_ALIAS_SET): Define to a68_get_alias_set.
    
    Signed-off-by: Kanishka Solanki <[email protected]>
    (cherry picked from commit c5c346c39a9224c52a13d26df4a7813d2e3727f6)

Diff:
---
 gcc/algol68/a68-lang.cc | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gcc/algol68/a68-lang.cc b/gcc/algol68/a68-lang.cc
index 0fa38c210e4a..1cefb08c5abd 100644
--- a/gcc/algol68/a68-lang.cc
+++ b/gcc/algol68/a68-lang.cc
@@ -786,6 +786,19 @@ a68_types_compatible_p (tree x, tree y)
 #undef LANG_HOOKS_TYPES_COMPATIBLE_P
 #define LANG_HOOKS_TYPES_COMPATIBLE_P a68_types_compatible_p
 
+/* Implements the lang_hooks.get_alias_set routine for Algol 68.  */
+
+static alias_set_type
+a68_get_alias_set (tree)
+{
+  /* For now in Algol 68, assume everything aliases everything else,
+     until aliasing rules are defined more precisely.  */
+  return 0;
+}
+
+#undef LANG_HOOKS_GET_ALIAS_SET
+#define LANG_HOOKS_GET_ALIAS_SET a68_get_alias_set
+
 /* Get a value for the SARIF v2.1.0 "artifact.sourceLanguage" property.  Algol
    68 is not yet listed in SARIF v2.1.0 Appendix J, but if/when it does, it
    will likely use this string.  */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.