forked from OSchip/llvm-project
76e85ae268
As reported in Bug 42535, `clang` doesn't inline atomic ops on 32-bit Sparc, unlike `gcc` on Solaris. In a 1-stage build with `gcc`, only two testcases are affected (currently `XFAIL`ed), while in a 2-stage build more than 100 tests `FAIL` due to this issue. The reason for this `gcc`/`clang` difference is that `gcc` on 32-bit Solaris/SPARC defaults to `-mpcu=v9` where atomic ops are supported, unlike with `clang`'s default of `-mcpu=v8`. This patch changes `clang` to use `-mcpu=v9` on 32-bit Solaris/SPARC, too. Doing so uncovered two bugs: `clang -m32 -mcpu=v9` chokes with any Solaris system headers included: /usr/include/sys/isa_defs.h:461:2: error: "Both _ILP32 and _LP64 are defined" #error "Both _ILP32 and _LP64 are defined" While `clang` currently defines `__sparcv9` in a 32-bit `-mcpu=v9` compilation, neither `gcc` nor Studio `cc` do. In fact, the Studio 12.6 `cc(1)` man page clearly states: These predefinitions are valid in all modes: [...] __sparcv8 (SPARC) __sparcv9 (SPARC -m64) At the same time, the patch defines `__GCC_HAVE_SYNC_COMPARE_AND_SWAP_[1248]` for a 32-bit Sparc compilation with any V9 cpu. I've also changed `MaxAtomicInlineWidth` for V9, matching what `gcc` does and the Oracle Developer Studio 12.6: C User's Guide documents (Ch. 3, Support for Atomic Types, 3.1 Size and Alignment of Atomic C Types). The two testcases that had been `XFAIL`ed for Bug 42535 are un-`XFAIL`ed again. Tested on `sparcv9-sun-solaris2.11` and `amd64-pc-solaris2.11`. Differential Revision: https://reviews.llvm.org/D86621 |
||
---|---|---|
.. | ||
ContinuousSyncMode | ||
Inputs | ||
Linux | ||
Posix | ||
Windows | ||
CMakeLists.txt | ||
coverage-inline.cpp | ||
coverage_comments.cpp | ||
gcc-flag-compatibility.test | ||
gcov-__gcov_flush-terminate.c | ||
gcov-basic.c | ||
gcov-dump-and-remove.c | ||
infinite_loop.c | ||
instrprof-basic.c | ||
instrprof-bufferio.c | ||
instrprof-darwin-dead-strip.c | ||
instrprof-darwin-exports.c | ||
instrprof-dump.c | ||
instrprof-error.c | ||
instrprof-gcov-exceptions.test | ||
instrprof-gcov-multiple-bbs-single-line.test | ||
instrprof-gcov-multithread_fork.test | ||
instrprof-gcov-one-line-function.test | ||
instrprof-gcov-switch.test | ||
instrprof-gcov-two-objects.test | ||
instrprof-get-filename.c | ||
instrprof-hostname.c | ||
instrprof-icall-promo.test | ||
instrprof-lto-pgogen.c | ||
instrprof-merge-match.test | ||
instrprof-merge.c | ||
instrprof-merging.cpp | ||
instrprof-order-file.test | ||
instrprof-override-filename-then-reset-default.c | ||
instrprof-override-filename-with-env.c | ||
instrprof-override-filename.c | ||
instrprof-path.c | ||
instrprof-reset-counters.c | ||
instrprof-set-dir-mode.c | ||
instrprof-set-file-object-merging.c | ||
instrprof-set-file-object.c | ||
instrprof-set-filename-then-reset-default.c | ||
instrprof-set-filename.c | ||
instrprof-value-prof-2.c | ||
instrprof-value-prof-evict.test | ||
instrprof-value-prof-reset.c | ||
instrprof-value-prof.c | ||
instrprof-value-prof.test | ||
instrprof-version-mismatch.c | ||
instrprof-without-libc.c | ||
instrprof-write-file-atexit-explicitly.c | ||
instrprof-write-file-only.c | ||
instrprof-write-file.c | ||
lit.cfg.py | ||
lit.site.cfg.py.in | ||
profile_test.h | ||
runtime_infinite.c |