]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PATCH] PR modula2/120606: FOR loop ICE if the last expression uses an array
authorGaius Mulley <gaiusmod2@gmail.com>
Thu, 17 Jul 2025 19:41:10 +0000 (20:41 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Thu, 17 Jul 2025 19:41:10 +0000 (20:41 +0100)
commit48e0ad74c108483a8be1d230d497c1331fba7824
tree3c61785027955fe7a81eff2e00046f38a35a25bf
parent7e4c25e375a458d1ae79f0fe648f8bf992cbc72b
[PATCH] PR modula2/120606: FOR loop ICE if the last expression uses an array

This patch fixes the ICE which occurs if the last expression is an array.
It ensures that the start and end values of the for loop expressions are
dereferenced.

gcc/m2/ChangeLog:

PR modula2/120606
* gm2-compiler/M2Quads.mod (ForLoopLastIterator): Dereference
start and end expressions e1 and e2 respectively.

gcc/testsuite/ChangeLog:

PR modula2/120606
* gm2/pim/pass/forarray.mod: New test.

(cherry picked from commit 639a147414ab2b870f9482123fcaa1821e0d5475)

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