This commit fixes a regression that I stupidly introduced ages ago
because I am dumb and I deserve all the hours of debugging that took
to find out what the heck was going on.

Signed-off-by: Jose E. Marchesi <[email protected]>

gcc/algol68/ChangeLog

        * a68-parser-moids-equivalence.cc (are_modes_equivalent): Do not
        string-compare INDICANTs.

gcc/testsuite/ChangeLog

        * algol68/compile/mode-shadow-1.a68: New test.
---
 gcc/algol68/a68-parser-moids-equivalence.cc     | 3 +--
 gcc/testsuite/algol68/compile/mode-shadow-1.a68 | 7 +++++++
 2 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100644 gcc/testsuite/algol68/compile/mode-shadow-1.a68

diff --git a/gcc/algol68/a68-parser-moids-equivalence.cc 
b/gcc/algol68/a68-parser-moids-equivalence.cc
index f97dcafc694..44177f64784 100644
--- a/gcc/algol68/a68-parser-moids-equivalence.cc
+++ b/gcc/algol68/a68-parser-moids-equivalence.cc
@@ -121,8 +121,7 @@ are_modes_equivalent (MOID_T * a, MOID_T * b)
       if (NODE (a) == NO_NODE || NODE (b) == NO_NODE)
        return false;
       else
-       return (NODE (a) == NODE (b)
-               || strcmp (NSYMBOL (NODE (a)), NSYMBOL (NODE (b))) == 0);
+       return NODE (a) == NODE (b);
     }
 
   /* Investigate structure.  */
diff --git a/gcc/testsuite/algol68/compile/mode-shadow-1.a68 
b/gcc/testsuite/algol68/compile/mode-shadow-1.a68
new file mode 100644
index 00000000000..d3b9cf082ae
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/mode-shadow-1.a68
@@ -0,0 +1,7 @@
+begin mode Foo = real;
+      begin mode Foo = int;
+            Foo i;
+            BIN i
+      end;
+      skip
+end
-- 
2.39.5

Reply via email to