diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2023-05-24 11:14:07 +0100 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2023-05-24 11:14:07 +0100 |
commit | b4df098647b687ca4e43952ec4a198b2816732ba (patch) | |
tree | a52492a7250d9322ff899b47a38d545036940333 /gcc/gimple-range.cc | |
parent | ee2a8b373a88bae4c533aa68bed56bf01afea0e2 (diff) | |
download | gcc-b4df098647b687ca4e43952ec4a198b2816732ba.zip gcc-b4df098647b687ca4e43952ec4a198b2816732ba.tar.gz gcc-b4df098647b687ca4e43952ec4a198b2816732ba.tar.bz2 |
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.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'gcc/gimple-range.cc')
0 files changed, 0 insertions, 0 deletions