File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,11 @@ static inline int atomic_fetch_add(int i, atomic_t *v)
45
45
static inline void atomic_add (int i , atomic_t * v )
46
46
{
47
47
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
48
- if (__builtin_constant_p (i ) && (i > -129 ) && (i < 128 )) {
48
+ /*
49
+ * Order of conditions is important to circumvent gcc 10 bug:
50
+ * https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549318.html
51
+ */
52
+ if ((i > -129 ) && (i < 128 ) && __builtin_constant_p (i )) {
49
53
__atomic_add_const (i , & v -> counter );
50
54
return ;
51
55
}
@@ -112,7 +116,11 @@ static inline s64 atomic64_fetch_add(s64 i, atomic64_t *v)
112
116
static inline void atomic64_add (s64 i , atomic64_t * v )
113
117
{
114
118
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
115
- if (__builtin_constant_p (i ) && (i > -129 ) && (i < 128 )) {
119
+ /*
120
+ * Order of conditions is important to circumvent gcc 10 bug:
121
+ * https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549318.html
122
+ */
123
+ if ((i > -129 ) && (i < 128 ) && __builtin_constant_p (i )) {
116
124
__atomic64_add_const (i , (long * )& v -> counter );
117
125
return ;
118
126
}
You can’t perform that action at this time.
0 commit comments