[Bug modula2/109952] Inconsistent HIGH values with 'ARRAY OF CHAR'
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Jul 29 03:14:29 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109952
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Gaius Mulley
<gaius@gcc.gnu.org>:
https://gcc.gnu.org/g:6ae50730003862aee81ad6c53e4c1a96ed1ee36e
commit r13-7640-g6ae50730003862aee81ad6c53e4c1a96ed1ee36e
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date: Sat Jul 29 04:13:34 2023 +0100
PR modula2/109952 Inconsistent HIGH values with 'ARRAY OF CHAR'
This patch fixes the case when a single character constant literal is
passed as a string actual parameter to an ARRAY OF CHAR formal parameter.
To be consistent a single character is promoted to a string and nul
terminated (and its high value is 1). Previously a single character
string would not be nul terminated and the high value was 0.
The documentation now includes a section describing the expected behavior
and included in this patch is some regression test code matching the
table inside the documentation.
gcc/ChangeLog:
PR modula2/109952
* doc/gm2.texi (High procedure function): New node.
(Using): New menu entry for High procedure function.
gcc/m2/ChangeLog:
PR modula2/109952
* Make-maintainer.in: Change header to include emacs file mode.
* gm2-compiler/M2GenGCC.mod (BuildHighFromChar): Check whether
operand is a constant string and is nul terminated then return one.
* gm2-compiler/PCSymBuild.mod (WalkFunction): Add default return
TRUE. Static analysis missing return path fix.
* gm2-libs/IO.mod (Init): Rewrite to help static analysis.
* target-independent/m2/gm2-libs.texi: Rebuild.
gcc/testsuite/ChangeLog:
PR modula2/109952
* gm2/pim/run/pass/hightests.mod: New test.
(cherry picked from commit b4df098647b687ca4e43952ec4a198b2816732ba)
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
More information about the Gcc-bugs
mailing list