http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54852
Bug #: 54852 Summary: Bogus(?) warnings when compiling gfortran.dg/bind_c_vars.f90 gfortran.dg/bind_c_vars_driver.c with -flto Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: domi...@lps.ens.fr When compiling gfortran.dg/bind_c_vars.f90 gfortran.dg/bind_c_vars_driver.c with -flto, one gets the following warnings which seem bogus: [macbook] f90/bug% /opt/gcc/gcc4.8a/bin/gfortran -flto /opt/gcc/work/gcc/testsuite/gfortran.dg/bind_c_vars.f90 /opt/gcc/work/gcc/testsuite/gfortran.dg/bind_c_vars_driver.c In file included from /opt/gcc/work/gcc/testsuite/gfortran.dg/bind_c_vars.f90:16:0, from :0: /opt/gcc/work/gcc/testsuite/gfortran.dg/bind_c_vars_driver.c:12:5: warning: type of 'myF90Array2D' does not match original declaration [enabled by default] int myF90Array2D[2][3]; /* B in bind_c_vars */ ^ In file included from :0:0: /opt/gcc/work/gcc/testsuite/gfortran.dg/bind_c_vars.f90:16:0: note: previously declared here integer(c_int), bind(c, name="myF90Array2D") :: B(3, 2) ^ In file included from /opt/gcc/work/gcc/testsuite/gfortran.dg/bind_c_vars.f90:16:0, from :0: /opt/gcc/work/gcc/testsuite/gfortran.dg/bind_c_vars_driver.c:11:5: warning: type of 'myF90Array3D' does not match original declaration [enabled by default] int myF90Array3D[10][5][18]; /* A in bind_c_vars */ ^ In file included from :0:0: /opt/gcc/work/gcc/testsuite/gfortran.dg/bind_c_vars.f90:15:0: note: previously declared here integer(c_int), bind(c, name="myF90Array3D") :: A(18, 3:7, 10) ^ The executable runs fine.