Andrew Pinski pointed out that this also fixes #19505 on mainline. I've given up hope of every getting these middle-end bugs that only affect Java fixed, so I'll install the front-end patch on mainline too. Andrew.