]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR modula2/117904: cc1gm2 ICE when compiling a const built from VAL and SIZE
authorGaius Mulley <gaiusmod2@gmail.com>
Thu, 5 Dec 2024 20:31:34 +0000 (20:31 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Thu, 5 Dec 2024 20:31:34 +0000 (20:31 +0000)
commit363382ac7c2b8f6a09415e905b349bb7eaeca38a
treeb6a77838bedbd969f5ec35443fe2c5878071b84d
parentb3cb0c3302a7c16e661a08c15c897c8f7bbb5d23
PR modula2/117904: cc1gm2 ICE when compiling a const built from VAL and SIZE

This patch fixes an ICE which occurs when a positive ZType constant
increment is used during a FOR loop.

gcc/m2/ChangeLog:

PR modula2/117904
* gm2-compiler/M2GenGCC.mod (PerformLastForIterator): Add call to
BuildConvert when increment is > 0.

gcc/testsuite/ChangeLog:

PR modula2/117904
* gm2/iso/pass/forloopbyconst.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2GenGCC.mod
gcc/testsuite/gm2/iso/pass/forloopbyconst.mod [new file with mode: 0644]