SCEVExpand computes the insertion point for the components of a SCEV to be code generated.
When it comes to generating code for a division SCEVexpand would not be able to check (at compilation time) all the conditions necessary to avoid a division by zero.
The patch disables hoisting of expressions containing divisions by anything other than constants in order to avoid hoisting these expressions past conditions that should hold before doing the division.
The patch passes check-all on x86_64-linux.