The divrem combine assumes the type of the div/rem is simple, which isn't necessarily true.
I'm guessing that it worked fine until r250825, since it probably only saw legal types, but now breaks when it runs as a pre-type-legalization combine.
This fixes PR26835.