ruby-changes:68074
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Wed, 22 Sep 2021 16:37:29 +0900 (JST)
Subject: [ruby-changes:68074] 0dea31c437 (master): RBIMPL_ATTR_NOALIAS: not until LLVM 12
https://git.ruby-lang.org/ruby.git/commit/?id=0dea31c437 From 0dea31c437abc59c80ece31e94cc5f8fb562c3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Tue, 21 Sep 2021 14:05:19 +0900 Subject: RBIMPL_ATTR_NOALIAS: not until LLVM 12 I observed CI failures. https://github.com/ruby/ruby/actions/runs/1240165911 It turns out that RBIMPL_ATTR_NOALIAS was not mature before. Skip using it for old clang, and everything work as expected. --- include/ruby/internal/attr/noalias.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/ruby/internal/attr/noalias.h b/include/ruby/internal/attr/noalias.h index 8e508b2..0790ef6 100644 --- a/include/ruby/internal/attr/noalias.h +++ b/include/ruby/internal/attr/noalias.h @@ -46,10 +46,21 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/attr/noalias.h#L46 * that has to be passed to the function as a pointer. ::VALUE -taking * functions thus cannot be attributed as such. */ +#include "ruby/internal/compiler_since.h" #include "ruby/internal/has/declspec_attribute.h" /** Wraps (or simulates) `__declspec((noalias))` */ -#if RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noalias) +#if RBIMPL_COMPILER_BEFORE(Clang, 12, 0, 0) +# /* +# * `::llvm::Attribute::ArgMemOnly` was buggy before. Maybe because nobody +# * actually seriously used it. It seems they somehow mitigated the situation +# * in LLVM 12. Still not found the exact changeset which fiexed the +# * attribute, though. +# * +# * :FIXME: others (armclang, xlclang, ...) can also be affected? +# */ +# define RBIMPL_ATTR_NOALIAS() /* void */ +#elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noalias) # define RBIMPL_ATTR_NOALIAS() __declspec(noalias) #else # define RBIMPL_ATTR_NOALIAS() /* void */ -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/