https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69370
Bug ID: 69370 Summary: Fortran spurious warning (regression)? 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: --- Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Build: gcc version 6.0.0 20160114 Compiling t.f90 with option -Wconversion active generates the warning 'Change of value in conversion from ‘REAL(8)’ to ‘REAL(4)’. This warning does not occur when the code is compiled by gcc 5.3 or gcc 4.4. The warning is not present if undef is set to less than about 2d10. I would appreciate it very much if the warning is expected. t.f90 program t real(8),parameter :: undef=3.33d33 real(4),parameter :: undef4=real(undef,4) end program t gcc-6: gfortran-6 -v -Wconversion t.f90 Driving: gfortran-6 -v -Wconversion t.f90 -l gfortran -l m -shared-libgcc Using built-in specs. COLLECT_GCC=gfortran-6 COLLECT_LTO_WRAPPER=/common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --prefix=/home/fsy/peschmid/lnx/sw --with-gmp=/home/fsy/peschmid/lnx/sw --with-mpfr=/home/fsy/peschmid/lnx/sw --with-mpc=/home/fsy/peschmid/lnx/sw --with-isl=/home/fsy/peschmid/lnx/sw --enable-__cxa_atexit --enable-languages=c,c++,fortran --program-suffix=-6 Thread model: posix gcc version 6.0.0 20160114 (experimental) (GCC) COLLECT_GCC_OPTIONS='-v' '-Wconversion' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.0.0/f951 t.f90 -quiet -dumpbase t.f90 -mtune=generic -march=x86-64 -auxbase t -Wconversion -version -fintrinsic-modules-path /common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/finclude -o /tmp/ccmDPJqS.s GNU Fortran (GCC) version 6.0.0 20160114 (experimental) (x86_64-pc-linux-gnu) compiled by GNU C version 6.0.0 20160114 (experimental), GMP version 6.0.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-pc-linux-gnu) compiled by GNU C version 6.0.0 20160114 (experimental), GMP version 6.0.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.f90:3:35: real(4),parameter :: undef4=real(undef,4) 1 Warning: Change of value in conversion from ‘REAL(8)’ to ‘REAL(4)’ at (1) [-Wconversion] COLLECT_GCC_OPTIONS='-v' '-Wconversion' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../x86_64-pc-linux-gnu/bin/as -v --64 -o /tmp/cc5lgPHU.o /tmp/ccmDPJqS.s GNU assembler version 2.25.51.0.4 (x86_64-pc-linux-gnu) using BFD version (Linux/GNU Binutils) 2.25.51.0.4.20151114 Reading specs from /common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../lib64/libgfortran.spec rename spec lib to liborig COLLECT_GCC_OPTIONS='-v' '-Wconversion' '-shared-libgcc' '-mtune=generic' '-march=x86-64' COMPILER_PATH=/common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.0.0/:/common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/:/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../x86_64-pc-linux-gnu/bin/ LIBRARY_PATH=/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/:/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/:/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/intel/composer_xe_2013.1.117/compiler/lib/intel64/:/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../x86_64-pc-linux-gnu/lib/:/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-Wconversion' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.0.0/collect2 -plugin /common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.0.0/liblto_plugin.so -plugin-opt=/common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccoi1UZW.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/crtbegin.o -L/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0 -L/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc -L/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/opt/intel/composer_xe_2013.1.117/compiler/lib/intel64 -L/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../x86_64-pc-linux-gnu/lib -L/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../.. /tmp/cc5lgPHU.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-pc-linux-gnu/6.0.0/crtend.o /usr/lib/../lib64/crtn.o COLLECT_GCC_OPTIONS='-v' '-Wconversion' '-shared-libgcc' '-mtune=generic' '-march=x86-64' gcc-5.3: gfortran -v -Wconversion t.f90 Driving: gfortran -v -Wconversion t.f90 -l gfortran -l m -shared-libgcc Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-5.3.0/configure --prefix=/home/fsy/peschmid/lnx/sw --with-gmp=/home/fsy/peschmid/lnx/sw --with-mpfr=/home/fsy/peschmid/lnx/sw --with-mpc=/home/fsy/peschmid/lnx/sw --with-isl=/home/fsy/peschmid/lnx/sw --enable-__cxa_atexit Thread model: posix gcc version 5.3.0 (GCC) COLLECT_GCC_OPTIONS='-v' '-Wconversion' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/f951 t.f90 -quiet -dumpbase t.f90 -mtune=generic -march=x86-64 -auxbase t -Wconversion -version -fintrinsic-modules-path /common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/finclude -o /tmp/ccxQbqiJ.s GNU Fortran (GCC) version 5.3.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 5.3.0, GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU Fortran2008 (GCC) version 5.3.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 5.3.0, GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 COLLECT_GCC_OPTIONS='-v' '-Wconversion' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../x86_64-unknown-linux-gnu/bin/as -v --64 -o /tmp/ccMTlmN9.o /tmp/ccxQbqiJ.s GNU assembler version 2.25.1 (x86_64-unknown-linux-gnu) using BFD version (GNU Binutils) 2.25.1 Reading specs from /common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/libgfortran.spec rename spec lib to liborig COLLECT_GCC_OPTIONS='-v' '-Wconversion' '-shared-libgcc' '-mtune=generic' '-march=x86-64' COMPILER_PATH=/common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/:/common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/:/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../x86_64-unknown-linux-gnu/bin/ LIBRARY_PATH=/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/:/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/:/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/intel/composer_xe_2013.1.117/compiler/lib/intel64/:/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../x86_64-unknown-linux-gnu/lib/:/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-Wconversion' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/collect2 -plugin /common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/liblto_plugin.so -plugin-opt=/common/home/fsy/peschmid/lnx/sw/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccnVDwjA.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/crtbegin.o -L/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0 -L/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc -L/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/opt/intel/composer_xe_2013.1.117/compiler/lib/intel64 -L/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../x86_64-unknown-linux-gnu/lib -L/common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../.. /tmp/ccMTlmN9.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /common/home/fsy/peschmid/lnx/sw/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/crtend.o /usr/lib/../lib64/crtn.o