Public bug reported: Not really sure where the issue is, whether it's mksh or gcc, but I'll try here first.
Since GCC 6.3 (also present in 6.4, didn't check 7.x) I get reproducible failure in tests if mksh was built with LTO: sh ./Build.sh -c lto ... ./tests.sh ... FAIL ./check.t:arith-ternary-prec-1 Description: Check precedence of ternary operator vs assignment unexpected exit status 0 (exit-code 0), expected e != 0 unexpected stderr - wanted pattern: /.*:.*1 \? 20 : x\+=2.*lvalue.*\n$/ got nothing If I run input from test: typeset -i x=2 y=$((1 ? 20 : x+=2)) the value of y is 22. ** Affects: mksh Importance: Undecided Status: New -- You received this bug notification because you are a member of mksh Mailing List, which is subscribed to mksh. Matching subscriptions: mkshlist-to-mksh-bugmail https://bugs.launchpad.net/bugs/1709716 Title: FAIL ./check.t:arith-ternary-prec-1 with GCC >= 6.3 and LTO Status in mksh: New Bug description: Not really sure where the issue is, whether it's mksh or gcc, but I'll try here first. Since GCC 6.3 (also present in 6.4, didn't check 7.x) I get reproducible failure in tests if mksh was built with LTO: sh ./Build.sh -c lto ... ./tests.sh ... FAIL ./check.t:arith-ternary-prec-1 Description: Check precedence of ternary operator vs assignment unexpected exit status 0 (exit-code 0), expected e != 0 unexpected stderr - wanted pattern: /.*:.*1 \? 20 : x\+=2.*lvalue.*\n$/ got nothing If I run input from test: typeset -i x=2 y=$((1 ? 20 : x+=2)) the value of y is 22. To manage notifications about this bug go to: https://bugs.launchpad.net/mksh/+bug/1709716/+subscriptions