Skip to content

Commit

Permalink
s390/atomic: remove small optimization to fix clang build
Browse files Browse the repository at this point in the history
With commit f0cbd3b ("s390/atomic: circumvent gcc 10 build
regression") there was an attempt to workaroud a gcc build bug,
however with the workaround a similar problem with clang appeared.
It was recommended to use a workaround which would fail again with
gcc. Therefore simply remove the optimization. It is just not worth
the effort.

Besides that all of this will be changed to use compiler atomic
builtins instead anyway.

See https://reviews.llvm.org/D90231
and https://reviews.llvm.org/D91786

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
  • Loading branch information
Heiko Carstens authored and Vasily Gorbik committed Jan 19, 2021
1 parent 4520a91 commit 6110cce
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions arch/s390/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ static inline int atomic_fetch_add(int i, atomic_t *v)

static inline void atomic_add(int i, atomic_t *v)
{
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
/*
* Order of conditions is important to circumvent gcc 10 bug:
* https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549318.html
*/
if ((i > -129) && (i < 128) && __builtin_constant_p(i)) {
__atomic_add_const(i, &v->counter);
return;
}
#endif
__atomic_add(i, &v->counter);
}

Expand Down Expand Up @@ -115,16 +105,6 @@ static inline s64 atomic64_fetch_add(s64 i, atomic64_t *v)

static inline void atomic64_add(s64 i, atomic64_t *v)
{
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
/*
* Order of conditions is important to circumvent gcc 10 bug:
* https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549318.html
*/
if ((i > -129) && (i < 128) && __builtin_constant_p(i)) {
__atomic64_add_const(i, (long *)&v->counter);
return;
}
#endif
__atomic64_add(i, (long *)&v->counter);
}

Expand Down

0 comments on commit 6110cce

Please sign in to comment.