Port changes from gcc-4.7 to gcc-4.6