[Flang-dev] Problem compiling flang with gcc 7.1

bunbury28+john john at bunbury28.plus.com
Mon Aug 28 10:00:36 EDT 2017


When I compile flang with gcc 4.9.2 it gets built.

When I compile flang with gcc 7.1 there are errors and it does not build.

[ 26%] Building C object 
tools/flang2/flang2exe/CMakeFiles/flang2.dir/ccffinfo.c.o
/home/fletcher/LLVM/flang-4.0.0/flang/tools/flang2/flang2exe/cgmain.c: 
In function ‘gen_va_arg’:
/home/fletcher/LLVM/flang-4.0.0/flang/tools/flang2/flang2exe/cgmain.c:3341:15: 
error: statement will never be executed [-Werror=switch-unreachable]
      arg_align = 8;
      ~~~~~~~~~~^~~
[ 27%] Building C object 
tools/flang2/flang2exe/CMakeFiles/flang2.dir/kmpcutil.c.o
/home/fletcher/LLVM/flang-4.0.0/flang/tools/flang1/flang1exe/semfunc.c: 
In function ‘ref_pd’:
/home/fletcher/LLVM/flang-4.0.0/flang/tools/flang1/flang1exe/semfunc.c:9551:11: 
error: statement will never be executed [-Werror=switch-unreachable]
        int sym = 0;
            ^~~

The command file for CMake is this:

/opt/cmake/bin/cmake -G  "Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX=/home/fletcher/LLVM/flang-4.0.0/local_71 \
-DCMAKE_C_COMPILER=/opt/gcc-7.1/bin/gcc \
-DCMAKE_CXX_COMPILER=/opt/gcc-7.1/bin/g++ \
-DCMAKE_Fortran_COMPILER=flang \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS=-Wno-error -Wno-switch-unreachable \
-DCMAKE_CXX_FLAGS=-std=c++11 \
-DLLVM_TARGETS_TO_BUILD="host" \
-DCMAKE_EXE_LINKER_FLAGS="-Xlinker -R/opt/gcc-7.1/lib64 
-L/opt/gcc-7.1/lib64" ../../flang

John Fletcher






More information about the flang-dev mailing list