Port revisions 199218 and 207709 from google/gcc-4_8 to bring the function