https://gcc.gnu.org/g:4cb4c35d75c5b1fec8b5271b844b1eecb40983e0
commit r17-4632-g4cb4c35d75c5b1fec8b5271b844b1eecb40983e0 Author: Jose E. Marchesi <[email protected]> Date: Thu Sep 24 21:06:27 2026 +0200 a68: fix regression in are_modes_equivalent 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. Diff: --- gcc/algol68/a68-parser-moids-equivalence.cc | 3 +-- gcc/testsuite/algol68/compile/mode-shadow-1.a68 | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/algol68/a68-parser-moids-equivalence.cc b/gcc/algol68/a68-parser-moids-equivalence.cc index f97dcafc694b..44177f64784d 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 000000000000..d3b9cf082ae6 --- /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
