facebook / facebook/folly

x86_64: ThreadCachedSynchronizedBench.cpp: error: impossible constraint in 'asm'

Open
#1,837 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
30.5k
Forks
5.9k
PR merge metrics
No merged PRs in 30d

Description

With 2022.08.15 `folly/concurrency/test/ThreadCachedSynchronizedBench.cpp` doesn't compile with gcc-12.1.1-4.fc38 on Fedora 38:

```
[ 40%] Building CXX object CMakeFiles/thread_cached_synchronized_benchmark.dir/folly/concurrency/test/ThreadCachedSynchronizedBench.cpp.o
/usr/bin/g++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DFMT_SHARED -DFOLLY_XLOG_STRIP_PREFIXES=\"/builddir/build/BUILD/folly-2022.08.15.00:/builddir/build/BUILD/folly-2022.08.15.00/redhat-linux-build\" -DGFLAGS_IS_A_DLL=0 -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -D_GNU_SOURCE -D_REENTRANT -I/builddir/build/BUILD/folly-2022.08.15.00 -I/builddir/build/BUILD/folly-2022.08.15.00/redhat-linux-build -I/usr/include/libdwarf-0 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fcoroutines -g -std=gnu++1z -finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wuninitialized -Wunused-label -Wunused-result -Wshadow-compatible-local -Wno-noexcept-type -faligned-new -fopenmp -std=gnu++17 -MD -MT CMakeFiles/thread_cached_synchronized_benchmark.dir/folly/concurrency/test/ThreadCachedSynchronizedBench.cpp.o -MF CMakeFiles/thread_cached_synchronized_benchmark.dir/folly/concurrency/test/ThreadCachedSynchronizedBench.cpp.o.d -o CMakeFiles/thread_cached_synchronized_benchmark.dir/folly/concurrency/test/ThreadCachedSynchronizedBench.cpp.o -c /builddir/build/BUILD/folly-2022.08.15.00/folly/concurrency/test/ThreadCachedSynchronizedBench.cpp
In file included from /builddir/build/BUILD/folly-2022.08.15.00/folly/lang/Hint.h:99,
from /builddir/build/BUILD/folly-2022.08.15.00/folly/lang/Assume.h:20,
from /builddir/build/BUILD/folly-2022.08.15.00/folly/lang/Bits.h:67,
from /builddir/build/BUILD/folly-2022.08.15.00/folly/hash/Hash.h:34,
from /builddir/build/BUILD/folly-2022.08.15.00/folly/Hash.h:20,
from /builddir/build/BUILD/folly-2022.08.15.00/folly/synchronization/ParkingLot.h:23,
from /builddir/build/BUILD/folly-2022.08.15.00/folly/detail/Futex-inl.h:19,
from /builddir/build/BUILD/folly-2022.08.15.00/folly/detail/Futex.h:109,
from /builddir/build/BUILD/folly-2022.08.15.00/folly/SharedMutex.h:30,
from /builddir/build/BUILD/folly-2022.08.15.00/folly/concurrency/ThreadCachedSynchronized.h:24,
from /builddir/build/BUILD/folly-2022.08.15.00/folly/concurrency/test/ThreadCachedSynchronizedBench.cpp:17:
In function 'folly::detail::compiler_must_not_predict >(folly::relaxed_atomic&, std::integral_constant)void',
inlined from 'folly::compiler_must_not_predict_fn::operator() >(folly::relaxed_atomic&) constvoid' at /builddir/build/BUILD/folly-2022.08.15.00/folly/lang/Hint-inl.h:130:36,
inlined from 'folly::makeUnpredictable >(folly::relaxed_atomic&)void' at /builddir/build/BUILD/folly-2022.08.15.00/folly/BenchmarkUtil.h:44:28,
inlined from 'bm_read_int >(folly::relaxed_atomic&, unsigned long)void' at /builddir/build/BUILD/folly-2022.08.15.00/folly/concurrency/test/ThreadCachedSynchronizedBench.cpp:48:29:
/builddir/build/BUILD/folly-2022.08.15.00/folly/lang/Hint-inl.h:109:3: warning: 'asm' operand 1 probably does not match constraints
109 | asm volatile("" : "+r"(t));
| ^~~
/builddir/build/BUILD/folly-2022.08.15.00/folly/lang/Hint-inl.h:109:3: error: impossible constraint in 'asm'
make[2]: *** [CMakeFiles/thread_cached_synchronized_benchmark.dir/build.make:79: CMakeFiles/thread_cached_synchronized_benchmark.dir/folly/concurrency/test/ThreadCachedSynchronizedBench.cpp.o] Error 1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.