https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84926
Bug ID: 84926 Summary: error: inlining failed in call to always_inline ‘_mm_crc32_u64’: target specific option mismatch _mm_crc32_u64 Product: gcc Version: 7.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: dilyan.palauzov at aegee dot org CC: marxin at gcc dot gnu.org Target Milestone: --- With the most current code of git://git.postgresql.org/git/postgresql.git, branch REL_10_STABLE, doing make maintainer-clean -j4; PYTHON=/usr/local/bin/python3.6 ./configure --prefix=/usr/local --with-perl --with-tcl --with-gssapi --with-ldap --with-openssl --with-libxml --with-libxslt --with-systemd --with-python --enable-cassert make CFLAGS="-flto" fails with make -C src all make[1]: Entering directory '/git/postgresql/src' make -C common all make[2]: Entering directory '/git/postgresql/src/common' make -C ../backend submake-errcodes make[3]: Entering directory '/git/postgresql/src/backend' make[3]: Nothing to be done for 'submake-errcodes'. make[3]: Leaving directory '/git/postgresql/src/backend' make[2]: Leaving directory '/git/postgresql/src/common' make -C port all make[2]: Entering directory '/git/postgresql/src/port' make -C ../backend submake-errcodes make[3]: Entering directory '/git/postgresql/src/backend' make[3]: Nothing to be done for 'submake-errcodes'. make[3]: Leaving directory '/git/postgresql/src/backend' gcc -flto -I../../src/port -DFRONTEND -I../../src/include -D_GNU_SOURCE -I/usr/local/include/libxml2 -c -o pg_crc32c_sse42.o pg_crc32c_sse42.c In file included from /usr/local/lib/gcc/x86_64-pc-linux-gnu/7.3.1/include/nmmintrin.h:31:0, from pg_crc32c_sse42.c:19: pg_crc32c_sse42.c: In function ‘pg_comp_crc32c_sse42’: /usr/local/lib/gcc/x86_64-pc-linux-gnu/7.3.1/include/smmintrin.h:846:1: error: inlining failed in call to always_inline ‘_mm_crc32_u64’: target specific option mismatch _mm_crc32_u64 (unsigned long long __C, unsigned long long __V) ^~~~~~~~~~~~~ pg_crc32c_sse42.c:37:18: note: called from here crc = (uint32) _mm_crc32_u64(crc, *((const uint64 *) p)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/local/lib/gcc/x86_64-pc-linux-gnu/7.3.1/include/nmmintrin.h:31:0, from pg_crc32c_sse42.c:19: /usr/local/lib/gcc/x86_64-pc-linux-gnu/7.3.1/include/smmintrin.h:839:1: error: inlining failed in call to always_inline ‘_mm_crc32_u32’: target specific option mismatch _mm_crc32_u32 (unsigned int __C, unsigned int __V) ^~~~~~~~~~~~~ pg_crc32c_sse42.c:44:7: note: called from here crc = _mm_crc32_u32(crc, *((const unsigned int *) p)); ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/local/lib/gcc/x86_64-pc-linux-gnu/7.3.1/include/nmmintrin.h:31:0, from pg_crc32c_sse42.c:19: /usr/local/lib/gcc/x86_64-pc-linux-gnu/7.3.1/include/smmintrin.h:827:1: error: inlining failed in call to always_inline ‘_mm_crc32_u8’: target specific option mismatch _mm_crc32_u8 (unsigned int __C, unsigned char __V) ^~~~~~~~~~~~ pg_crc32c_sse42.c:63:7: note: called from here crc = _mm_crc32_u8(crc, *p); ~~~~^~~~~~~~~~~~~~~~~~~~~~~ make[2]: *** [<builtin>: pg_crc32c_sse42.o] Error 1 make[2]: Leaving directory '/git/postgresql/src/port' make[1]: *** [Makefile:38: all-port-recurse] Error 2 make[1]: Leaving directory '/git/postgresql/src' make: *** [GNUmakefile:11: all-src-recurse] Error 2 without -flto it works. I use gcc 7.3.1 20180316. With gcc 6.4.1 20180308 it also worked. I don't think this is relevant, but after switching 6->7 I have updated /usr/local/lib/bfd-plugin/liblto_plugin.so.0.0.0 to point to the new location.