Dear all, I've committed an obvious fix for the testcase to avoid recursive I/O, as it did cause a hang on some systems: https://gcc.gnu.org/g:36a4ee406b95ae24a59b8b3f8ebe29af6fd5261e Confirmed by Jerry that this resolves his issue. See also attached. Thanks, Harald Am 29.11.22 um 09:08 schrieb Paul Richard Thomas via Gcc-patches: > Hi Harald, > > It looks good to me. > > Thanks to you and Steve for the patch. > > Paul > > > On Mon, 28 Nov 2022 at 20:05, Harald Anlauf via Fortran > wrote: > >> Dear all, >> >> as reported, the Fortran standard requires all actual argument >> expressions to be evaluated (e.g. F2018:15.5.3). >> >> There were two cases for intrinsic MERGE where we failed to do so: >> >> - non-constant mask; Steve provided the patch >> >> - constant scalar mask; we need to be careful to simplify only if >> the argument on the "other" path is known to be constant so that >> it does not have side-effects and can be immediately removed. >> >> The latter change needed a correction of a sub-test of testcase >> merge_init_expr_2.f90, which should not have been simplified >> the way the original author assumed. I decided to modify the >> test in such way that simplification is valid and provides >> the expect pattern. >> >> Regtested on x86_64-pc-linux-gnu. OK for mainline? >> >> Thanks, >> Harald >> > >