[Bug gcov-profile/104685] multiple common of `__gcov_var'

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 25 12:30:38 GMT 2022


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


More information about the Gcc-bugs mailing list