https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104685
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Using link-time optimization is a more reliable way of detecting real errors here btw: rguenther@ryzen:/tmp> cat t1.c int i; rguenther@ryzen:/tmp> cat t2.c float i; int main() { return i; } rguenther@ryzen:/tmp> gcc-7 t1.c t2.c -flto t2.c:1:7: warning: type of 'i' does not match original declaration [-Wlto-type-mismatch] float i; ^ t1.c:1:5: note: type 'int' should match type 'float' int i; ^ t1.c:1:5: note: 'i' was previously declared here t1.c:1:5: note: code may be misoptimized unless -fno-strict-aliasing is used