https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78120 --- Comment #9 from James Greenhalgh <jgreenhalgh at gcc dot gnu.org> --- I haven't had a chance to bootstrap or benchmark it, but your patch looks reasonable to me.