diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-10-22 15:08:29 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-10-23 23:02:15 +0900 |
commit | 7d1011d3fa7226c47adf2914fb9035304f233cb2 () | |
tree | 9776d602733bc51d6b3b439abdbee84d9b7c0ee0 /include | |
parent | 47f6ba349f531ac9cfe0c42bfaa81b087143770d (diff) |
Fix false warning by gcc 14 for aarch64
gcc 14 for aarch64 with `-O3` may emit a false positive warning for a pointer access of `RB_BUILTIN_TYPE` called from `RB_TYPE_P`. `Qfalse` shouldn't get there because of `RB_SPECIAL_CONST_P`, but the optimizer seems to ignore this condition in some cases (`ASSUME` just before the access doesn't seem to have any effect either). Only by reversing the order in `RB_SPECIAL_CONST_P` to compare with 0 first does the warning seem to go away.
Notes: Merged: https://.com/ruby/ruby/pull/11928
-rw-r--r-- | include/ruby/internal/special_consts.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -326,7 +326,7 @@ RBIMPL_ATTR_ARTIFICIAL() static inline bool RB_SPECIAL_CONST_P(VALUE obj) { - return RB_IMMEDIATE_P(obj) || obj == RUBY_Qfalse; } RBIMPL_ATTR_CONST() |