The patch from D110529 partially solves the problem of bug51600 . However, the reason for crashing is that if an argument is byval, and if the function is not readonly, 'ValueState' will not record the argument(in SCCPInstVisitor::handleCallArguments), and thus we cannot find its value state (in getPossibleConstants) and this leads to an assertation failure or crash.
The problem still exists in the current codebase, and this patch can solve it and also relax the constraint on constant expression. The attached test cases *-expression4.ll and *-expression5.ll can bypass the check of global variable and constant expression and trigger assertation failure.