From: jcmvbkbc Date: Tue, 4 Sep 2018 17:43:20 +0000 (+0000) Subject: gcc: xtensa: fix NAND code in xtensa_expand_atomic X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=174ff8eae85b6b75ef4c5f1bcd107d32585fe20c;p=thirdparty%2Fgcc.git gcc: xtensa: fix NAND code in xtensa_expand_atomic NAND is ~(a1 & a2), but xtensa_expand_atomic does ~a1 & a2. That fixes libatomic tests atomic-op-{1,2}. gcc/ 2018-09-04 Max Filippov * config/xtensa/xtensa.c (xtensa_expand_atomic): Reorder AND and XOR operations in NAND case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264087 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9b0d2d11771c..2b4c04b71e28 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-09-04 Max Filippov + + * config/xtensa/xtensa.c (xtensa_expand_atomic): Reorder AND and + XOR operations in NAND case. + 2018-09-04 Aldy Hernandez * wide-int-range.cc (wide_int_range_convert): New. diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 7cfe64d42895..080bb4ad765d 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -1614,9 +1614,9 @@ xtensa_expand_atomic (enum rtx_code code, rtx target, rtx mem, rtx val, break; case MULT: /* NAND */ - tmp = expand_simple_binop (SImode, XOR, old, ac.modemask, + tmp = expand_simple_binop (SImode, AND, old, val, NULL_RTX, 1, OPTAB_DIRECT); - tmp = expand_simple_binop (SImode, AND, tmp, val, + tmp = expand_simple_binop (SImode, XOR, tmp, ac.modemask, new_rtx, 1, OPTAB_DIRECT); break;