Skip to content

Commit 11e21f5

Browse files
committed
Fix a bug in the lower_do_stmt() function of the lowerilm.c source file.
1 parent d568279 commit 11e21f5

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

tools/flang1/flang1exe/lowerilm.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,17 +2084,18 @@ lower_do_stmt(int std, int ast, int lineno, int label)
20842084
ilm = compute_dotrip(std, FALSE, doinitilm, doendilm, doinc,
20852085
doincilm, dtype, dotrip);
20862086
} else
2087-
ilm = compute_dotrip(std, doinitast == doincast, doinitilm, doendilm, doinc,
2088-
doincilm, dtype, dotrip);
2089-
2090-
if (doinc == 0) {
2091-
/* convert and store in a temp */
2092-
doinc = dotemp('i', dtype, std);
2093-
lilm = lower_sptr(doinc, VarBase);
2094-
lower_typestore(dtype, lilm, doincilm);
2087+
{
2088+
ilm = compute_dotrip(std, doinitast == doincast, doinitilm,
2089+
doendilm, doinc, doincilm, dtype, dotrip);
2090+
if (doinc == 0) {
2091+
/* convert and store in a temp */
2092+
doinc = dotemp('i', dtype, std);
2093+
lilm = lower_sptr(doinc, VarBase);
2094+
lower_typestore(dtype, lilm, doincilm);
2095+
}
2096+
lilm = lower_sptr(dovar, VarBase);
2097+
lower_typestore(dtype, lilm, doinitilm);
20952098
}
2096-
lilm = lower_sptr(dovar, VarBase);
2097-
lower_typestore(dtype, lilm, doinitilm);
20982099
if (!XBIT(34, 0x8000000) && STD_ZTRIP(std) && A_M4G(ast)) {
20992100
/* lower condition ilm */
21002101
int tilm;

0 commit comments

Comments
 (0)