cherry-pick justarchi's optimisations for global

janice has no problem with this and kernel will still be built using gcc 4.6 so why not?