aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorGaius Mulley <gaiusmod2@gmail.com>2023-05-04 18:15:59 +0100
committerGaius Mulley <gaiusmod2@gmail.com>2023-05-04 18:15:59 +0100
commitac7c9954ece9a75c5e7c3b76a4800f2432002487 (patch)
tree7c39cd9526e4cf8884d6ea03d9797b5e0c949ceb /libcpp
parent4657977541de1056a1cb651d6e2ba22472f62d04 (diff)
downloadgcc-ac7c9954ece9a75c5e7c3b76a4800f2432002487.zip
gcc-ac7c9954ece9a75c5e7c3b76a4800f2432002487.tar.gz
gcc-ac7c9954ece9a75c5e7c3b76a4800f2432002487.tar.bz2
PR modula2/109729 cannot use a CHAR type as a FOR loop iterator
This patch introduces a new quadruple ArithAddOp which is used in the construction of FOR loop to ensure that when constant folding is applied it does not concatenate two constant char operands into a string constant. Overloading only occurs with constant operands. gcc/m2/ChangeLog: PR modula2/109729 * gm2-compiler/M2GenGCC.mod (CodeStatement): Detect ArithAddOp and call CodeAddChecked. (ResolveConstantExpressions): Detect ArithAddOp and call FoldArithAdd. (FoldArithAdd): New procedure. (FoldAdd): Refactor to use FoldArithAdd. * gm2-compiler/M2Quads.def (QuadOperator): Add ArithAddOp. * gm2-compiler/M2Quads.mod: Remove commented imports. (QuadFrame): Changed comments to use GNU coding standards. (ArithPlusTok): New global variable. (BuildForToByDo): Use ArithPlusTok instead of PlusTok. (MakeOp): Detect ArithPlusTok and return ArithAddOp. (WriteQuad): Add ArithAddOp clause. (WriteOperator): Add ArithAddOp clause. (Init): Initialize ArithPlusTok. gcc/testsuite/ChangeLog: PR modula2/109729 * gm2/pim/run/pass/ForChar.mod: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions