Bug #13014
closedAdding clang volatile fixes from FreeBSD and NetBSD
Description
Referring to bug #12893, where segfaults were observed when compiling with recent versions of clang. In particular in cont.c, about which Shugo Maeda noted that he could reproduce this on FreeBSD. These segfaults are most likely caused by missing volatile specifiers on certain variable declarations, in combination with the use of setjmp().
In https://bugs.freebsd.org/206111 (for ruby 2.3), we have applied a number of fixes for this, taken mostly from NetBSD's pkgsrc. These add a few volatile specifiers in critical places. I have also added one additional volatile specifier in cont_capture() in cont.c, and removed the special optnone handling for clang 3.8.0.
For me, on FreeBSD 12 with clang 3.9.1, and optimizing at -O3 for -march=haswell, this successfully completes "gmake test-all":
Finished tests in 461.890990s, 36.8312 tests/s, 4849.7937 assertions/s.
17012 tests, 2240076 assertions, 0 failures, 0 errors, 40 skips
Files