]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR modula2/120606: FOR loop ICE if the last expression uses an array
authorGaius Mulley <gaiusmod2@gmail.com>
Mon, 9 Jun 2025 17:26:36 +0000 (18:26 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Mon, 9 Jun 2025 17:26:36 +0000 (18:26 +0100)
commit639a147414ab2b870f9482123fcaa1821e0d5475
tree6254790aabd4bf28d8340dc7073b1854bd7b2259
parentb0d50cbb42ab2ce5fab8a832cb82fc54b371c914
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.

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]