diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2023-04-13 17:02:48 +0100 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2023-04-13 17:02:48 +0100 |
commit | a1afdc6e2aa77d0a990e1a82aceeffc837b7e50c (patch) | |
tree | 914badeca002aff6b9ecf223c05cb749804e7f4d /gcc/gimple-range-cache.cc | |
parent | 66946624b96b762985de56444d726a0ebd4e0df5 (diff) | |
download | gcc-a1afdc6e2aa77d0a990e1a82aceeffc837b7e50c.zip gcc-a1afdc6e2aa77d0a990e1a82aceeffc837b7e50c.tar.gz gcc-a1afdc6e2aa77d0a990e1a82aceeffc837b7e50c.tar.bz2 |
PR modula2/109496 Fix constant char parameter passing to an array of char
This patch fixes PR modula2/109496 and PR modula2/109497. The fix for
PR modula2/109496 promotes a char constant to a string. The PR
modula2/109497 allows for constant chars to be added to form a string.
The fixes for both PR's occur in M2GenGCC.mod and M2GCCDeclare.mod
after the resolving of constant declarations.
gcc/m2/ChangeLog:
* gm2-compiler/M2ALU.def (PopChar): New procedure function.
* gm2-compiler/M2ALU.mod (PopChar): New procedure function.
* gm2-compiler/M2GCCDeclare.mod (PromoteToString): Detect
a single constant char and build a C string.
* gm2-compiler/M2GenGCC.mod (IsConstStr): New procedure
function.
(GetStr): New procedure function.
(FoldAdd): Use IsConstStr.
* gm2-compiler/M2Quads.mod: Formatting changes.
* gm2-gcc/m2expr.cc (m2expr_GetCstInteger): New function.
* gm2-gcc/m2expr.def (GetCstInteger): New procedure function.
* gm2-gcc/m2expr.h (m2expr_GetCstInteger): New prototype.
gcc/testsuite/ChangeLog:
PR modula2/109497
* gm2/pim/run/pass/addcharconst.mod: New test.
PR modula2/109496
* gm2/pim/run/pass/singlechar.mod: New test.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'gcc/gimple-range-cache.cc')
0 files changed, 0 insertions, 0 deletions