Backporting the full X stack (including kernel 4.10, xorg 1.19.3) from 17.04 to 16.04 didn't break it, so looks like the breakage is due to some compiler issue on 17.04? That sounds like a treat to track down..