https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69303

            Bug ID: 69303
           Summary: Fortran character common block equivalence lto
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: physiker at toast2 dot net
  Target Milestone: ---

Created attachment 37361
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37361&action=edit
Tarfile von source files and include file

Fortran character common block equivalence lto

Compiling p.f90 and mi.f90 into a shared library with the -flto opion active
causes a strange "warning: type of 't' does not match original declaration".
The definition of the common block is identical in both input files (include
statement), though. The same message occurs when the files are compiled with
gcc-5.3 on osx or on linux. 

bash-3.2$ gfortran-6 -v -W -Wall -pedantic -fPIC -flto -c p.f90
Using built-in specs.
COLLECT_GCC=gfortran-6
Target: x86_64-apple-darwin13.4.0
Configured with: ../gcc/configure --enable-languages=c,c++,fortran,lto
--with-gmp=/sw --with-libiconv-prefix=/sw --with-isl=/sw --with-mpc=/sw
--with-system-zlib --program-suffix=-6
Thread model: posix
gcc version 6.0.0 20160114 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-Wextra' '-Wall' '-Wpedantic' '-fPIC' '-flto' '-c'
'-mmacosx-version-min=10.9.4' '-mtune=core2'
 /usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/f951 p.f90 -fPIC -quiet
-dumpbase p.f90 -mmacosx-version-min=10.9.4 -mtune=core2 -auxbase p -Wextra
-Wall -Wpedantic -version -fPIC -flto -fintrinsic-modules-path
/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/finclude -o
/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccXvZBVk.s
GNU Fortran (GCC) version 6.0.0 20160114 (experimental)
(x86_64-apple-darwin13.4.0)
        compiled by GNU C version 6.0.0 20160114 (experimental), GMP version
6.1.0, MPFR version 3.1.3, MPC version 1.0.3, isl version 0.14 or 0.13
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Fortran2008 (GCC) version 6.0.0 20160114 (experimental)
(x86_64-apple-darwin13.4.0)
        compiled by GNU C version 6.0.0 20160114 (experimental), GMP version
6.1.0, MPFR version 3.1.3, MPC version 1.0.3, isl version 0.14 or 0.13
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
COLLECT_GCC_OPTIONS='-v' '-Wextra' '-Wall' '-Wpedantic' '-fPIC' '-flto' '-c'
'-mmacosx-version-min=10.9.4' '-mtune=core2'
 as -arch x86_64 -force_cpusubtype_ALL -o p.o
/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccXvZBVk.s
COMPILER_PATH=/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/
LIBRARY_PATH=/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/../../../
COLLECT_GCC_OPTIONS='-v' '-Wextra' '-Wall' '-Wpedantic' '-fPIC' '-flto' '-c'
'-mmacosx-version-min=10.9.4' '-mtune=core2'
bash-3.2$ gfortran-6 -v -W -Wall -pedantic -fPIC -flto -c mi.f90 
Using built-in specs.
COLLECT_GCC=gfortran-6
Target: x86_64-apple-darwin13.4.0
Configured with: ../gcc/configure --enable-languages=c,c++,fortran,lto
--with-gmp=/sw --with-libiconv-prefix=/sw --with-isl=/sw --with-mpc=/sw
--with-system-zlib --program-suffix=-6
Thread model: posix
gcc version 6.0.0 20160114 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-Wextra' '-Wall' '-Wpedantic' '-fPIC' '-flto' '-c'
'-mmacosx-version-min=10.9.4' '-mtune=core2'
 /usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/f951 mi.f90 -fPIC
-quiet -dumpbase mi.f90 -mmacosx-version-min=10.9.4 -mtune=core2 -auxbase mi
-Wextra -Wall -Wpedantic -version -fPIC -flto -fintrinsic-modules-path
/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/finclude -o
/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccVvSs2m.s
GNU Fortran (GCC) version 6.0.0 20160114 (experimental)
(x86_64-apple-darwin13.4.0)
        compiled by GNU C version 6.0.0 20160114 (experimental), GMP version
6.1.0, MPFR version 3.1.3, MPC version 1.0.3, isl version 0.14 or 0.13
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Fortran2008 (GCC) version 6.0.0 20160114 (experimental)
(x86_64-apple-darwin13.4.0)
        compiled by GNU C version 6.0.0 20160114 (experimental), GMP version
6.1.0, MPFR version 3.1.3, MPC version 1.0.3, isl version 0.14 or 0.13
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
COLLECT_GCC_OPTIONS='-v' '-Wextra' '-Wall' '-Wpedantic' '-fPIC' '-flto' '-c'
'-mmacosx-version-min=10.9.4' '-mtune=core2'
 as -arch x86_64 -force_cpusubtype_ALL -o mi.o
/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccVvSs2m.s
COMPILER_PATH=/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/
LIBRARY_PATH=/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/../../../
COLLECT_GCC_OPTIONS='-v' '-Wextra' '-Wall' '-Wpedantic' '-fPIC' '-flto' '-c'
'-mmacosx-version-min=10.9.4' '-mtune=core2'
bash-3.2$ gfortran-6 -v -dynamiclib -flto -o l.dylib p.o mi.o
Driving: gfortran-6 -v -dynamiclib -flto -o l.dylib p.o mi.o
-mmacosx-version-min=10.9.4 -l gfortran -shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran-6
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/lto-wrapper
Target: x86_64-apple-darwin13.4.0
Configured with: ../gcc/configure --enable-languages=c,c++,fortran,lto
--with-gmp=/sw --with-libiconv-prefix=/sw --with-isl=/sw --with-mpc=/sw
--with-system-zlib --program-suffix=-6
Thread model: posix
gcc version 6.0.0 20160114 (experimental) (GCC) 
Reading specs from
/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/../../../libgfortran.spec
rename spec lib to liborig
COLLECT_GCC_OPTIONS='-v' '-Zdynamiclib' '-flto' '-o' 'l.dylib'
'-mmacosx-version-min=10.9.4' '-shared-libgcc' '-mtune=core2'
COMPILER_PATH=/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/
LIBRARY_PATH=/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/../../../
COLLECT_GCC_OPTIONS='-v' '-Zdynamiclib' '-flto' '-o' 'l.dylib'
'-mmacosx-version-min=10.9.4' '-shared-libgcc' '-mtune=core2'
 /usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/collect2 -flto -dynamic
-dylib -arch x86_64 -macosx_version_min 10.9.4 -weak_reference_mismatches
non-weak -o l.dylib -L/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0
-L/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/../../.. p.o mi.o
-lgfortran -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lquadmath -lm
-lgcc_ext.10.5 -lgcc -lSystem -v
collect2 version 6.0.0 20160114 (experimental)
/usr/bin/ld -dynamic -dylib -arch x86_64 -macosx_version_min 10.9.4
-weak_reference_mismatches non-weak -o l.dylib
-L/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0
-L/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/../../.. p.o mi.o
-lgfortran -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lquadmath -lm
-lgcc_ext.10.5 -lgcc -lSystem -v
@(#)PROGRAM:ld  PROJECT:ld64-241.9
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h
armv6m armv7m armv7em
Library search paths:
        /usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0
        /usr/local/lib
        /usr/lib
        /usr/local/lib
Framework search paths:
        /Library/Frameworks/
        /System/Library/Frameworks/
 /usr/bin/nm -n p.o
 /usr/bin/nm -n mi.o
/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/lto-wrapper p.o mi.o
gfortran-6 @/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccNa3izc
Using built-in specs.
COLLECT_GCC=gfortran-6
Target: x86_64-apple-darwin13.4.0
Configured with: ../gcc/configure --enable-languages=c,c++,fortran,lto
--with-gmp=/sw --with-libiconv-prefix=/sw --with-isl=/sw --with-mpc=/sw
--with-system-zlib --program-suffix=-6
Thread model: posix
gcc version 6.0.0 20160114 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-c' '-fno-math-errno' '-fsigned-zeros' '-ftrapping-math'
'-fno-trapv' '-fno-strict-overflow' '-fno-openmp' '-fno-openacc'
'-mmacosx-version-min=10.9.4' '-mtune=core2' '-fPIC' '-v' '-Zdynamiclib'
'-mmacosx-version-min=10.9.4' '-shared-libgcc' '-mtune=core2' '-dumpdir' './'
'-dumpbase' 'l.dylib.wpa'
'-fltrans-output-list=/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccytCw7u.ltrans.out'
'-fwpa'
 /usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/lto1 -fPIC -quiet
-dumpdir ./ -dumpbase l.dylib.wpa -mmacosx-version-min=10.9.4 -mtune=core2
-mmacosx-version-min=10.9.4 -mtune=core2 -auxbase p -version -fno-math-errno
-fsigned-zeros -ftrapping-math -fno-trapv -fno-strict-overflow -fno-openmp
-fno-openacc -fPIC
-fltrans-output-list=/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccytCw7u.ltrans.out
-fwpa @/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//cciv3hDN
GNU GIMPLE (GCC) version 6.0.0 20160114 (experimental)
(x86_64-apple-darwin13.4.0)
        compiled by GNU C version 6.0.0 20160114 (experimental), GMP version
6.1.0, MPFR version 3.1.3, MPC version 1.0.3, isl version 0.14 or 0.13
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU GIMPLE (GCC) version 6.0.0 20160114 (experimental)
(x86_64-apple-darwin13.4.0)
        compiled by GNU C version 6.0.0 20160114 (experimental), GMP version
6.1.0, MPFR version 3.1.3, MPC version 1.0.3, isl version 0.14 or 0.13
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
t.inc:1:0: warning: type of 't' does not match original declaration
[-Wlto-type-mismatch]
       COMMON /T/ I(7)


t.inc:1:0: note: 't' was previously declared here
       COMMON /T/ I(7)


t.inc:1:0: note: code may be misoptimized unless -fno-strict-aliasing is used
COMPILER_PATH=/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/
LIBRARY_PATH=/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/../../../:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/../../../
COLLECT_GCC_OPTIONS='-c' '-fno-math-errno' '-fsigned-zeros' '-ftrapping-math'
'-fno-trapv' '-fno-strict-overflow' '-fno-openmp' '-fno-openacc'
'-mmacosx-version-min=10.9.4' '-mtune=core2' '-fPIC' '-v' '-Zdynamiclib'
'-mmacosx-version-min=10.9.4' '-shared-libgcc' '-mtune=core2' '-dumpdir' './'
'-dumpbase' 'l.dylib.wpa'
'-fltrans-output-list=/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccytCw7u.ltrans.out'
'-fwpa'
gfortran-6 @/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccM8N4oQ
Using built-in specs.
COLLECT_GCC=gfortran-6
Target: x86_64-apple-darwin13.4.0
Configured with: ../gcc/configure --enable-languages=c,c++,fortran,lto
--with-gmp=/sw --with-libiconv-prefix=/sw --with-isl=/sw --with-mpc=/sw
--with-system-zlib --program-suffix=-6
Thread model: posix
gcc version 6.0.0 20160114 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-c' '-fno-math-errno' '-fsigned-zeros' '-ftrapping-math'
'-fno-trapv' '-fno-strict-overflow' '-fno-openmp' '-fno-openacc'
'-mmacosx-version-min=10.9.4' '-mtune=core2' '-fPIC' '-v' '-Zdynamiclib'
'-mmacosx-version-min=10.9.4' '-shared-libgcc' '-mtune=core2' '-dumpdir' './'
'-dumpbase' 'l.dylib.ltrans0' '-fltrans' '-o'
'/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccytCw7u.ltrans0.ltrans.o'
 /usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/lto1 -fPIC -quiet
-dumpdir ./ -dumpbase l.dylib.ltrans0 -mmacosx-version-min=10.9.4 -mtune=core2
-mmacosx-version-min=10.9.4 -mtune=core2 -auxbase-strip
/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccytCw7u.ltrans0.ltrans.o
-version -fno-math-errno -fsigned-zeros -ftrapping-math -fno-trapv
-fno-strict-overflow -fno-openmp -fno-openacc -fPIC -fltrans
@/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccqhcI14 -o
/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccosfwXb.s
GNU GIMPLE (GCC) version 6.0.0 20160114 (experimental)
(x86_64-apple-darwin13.4.0)
        compiled by GNU C version 6.0.0 20160114 (experimental), GMP version
6.1.0, MPFR version 3.1.3, MPC version 1.0.3, isl version 0.14 or 0.13
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU GIMPLE (GCC) version 6.0.0 20160114 (experimental)
(x86_64-apple-darwin13.4.0)
        compiled by GNU C version 6.0.0 20160114 (experimental), GMP version
6.1.0, MPFR version 3.1.3, MPC version 1.0.3, isl version 0.14 or 0.13
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
COLLECT_GCC_OPTIONS='-c' '-fno-math-errno' '-fsigned-zeros' '-ftrapping-math'
'-fno-trapv' '-fno-strict-overflow' '-fno-openmp' '-fno-openacc'
'-mmacosx-version-min=10.9.4' '-mtune=core2' '-fPIC' '-v' '-Zdynamiclib'
'-mmacosx-version-min=10.9.4' '-shared-libgcc' '-mtune=core2' '-dumpdir' './'
'-dumpbase' 'l.dylib.ltrans0' '-fltrans' '-o'
'/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccytCw7u.ltrans0.ltrans.o'
 as -arch x86_64 -force_cpusubtype_ALL -o
/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccytCw7u.ltrans0.ltrans.o
/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccosfwXb.s
COMPILER_PATH=/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/
LIBRARY_PATH=/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/../../../:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/../../../
COLLECT_GCC_OPTIONS='-c' '-fno-math-errno' '-fsigned-zeros' '-ftrapping-math'
'-fno-trapv' '-fno-strict-overflow' '-fno-openmp' '-fno-openacc'
'-mmacosx-version-min=10.9.4' '-mtune=core2' '-fPIC' '-v' '-Zdynamiclib'
'-mmacosx-version-min=10.9.4' '-shared-libgcc' '-mtune=core2' '-dumpdir' './'
'-dumpbase' 'l.dylib.ltrans0' '-fltrans' '-o'
'/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccytCw7u.ltrans0.ltrans.o'
/usr/bin/ld -dynamic -dylib -arch x86_64 -macosx_version_min 10.9.4
-weak_reference_mismatches non-weak -o l.dylib
-L/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0
-L/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0/../../..
/var/folders/97/4qnhjhtn25s86s9hkz0h37_m0000gn/T//ccytCw7u.ltrans0.ltrans.o
-lgfortran -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lquadmath -lm
-lgcc_ext.10.5 -lgcc -lSystem -v
@(#)PROGRAM:ld  PROJECT:ld64-241.9
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h
armv6m armv7m armv7em
Library search paths:
        /usr/local/lib/gcc/x86_64-apple-darwin13.4.0/6.0.0
        /usr/local/lib
        /usr/lib
        /usr/local/lib
Framework search paths:
        /Library/Frameworks/
        /System/Library/Frameworks/

Reply via email to