https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99977
Alex Coplan changed:
What|Removed |Added
Resolution|--- |FIXED
Status|ASSIGNED
: Wed Apr 6 11:16:10 2022 +0100
arm: Fix ICEs with compare-and-swap and -march=armv8-m.base [PR99977]
The PR shows two ICEs with __sync_bool_compare_and_swap and
-mcpu=cortex-m23 (equivalently, -march=armv8-m.base): one in LRA and one
later on, after the CAS insn is split
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
--- Comment #10 from Thiago Macieira ---
You're right that emitting more penalises those who have done their job and
written proper code.
The problem we're seeing is that such code appears to be the minority. Or,
maybe put differently, the bad
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
--- Comment #9 from Jonathan Wakely ---
I don't know what the assembly code does sorry, but it's not permitted to store
to the 'expected' value unless the atomic variable is not equal to it. It looks
like this would update the 'expected' value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
--- Comment #8 from Jakub Jelinek ---
(In reply to H.J. Lu from comment #7)
> Instead of generating:
>
> movlf(%rip), %eax
> .L2:
> movd%eax, %xmm0
> addss .LC0(%rip), %xmm0
> movd%xmm0, %edx
> lock
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
--- Comment #7 from H.J. Lu ---
Instead of generating:
movlf(%rip), %eax
.L2:
movd%eax, %xmm0
addss .LC0(%rip), %xmm0
movd%xmm0, %edx
lock cmpxchgl %edx, f(%rip)
jne .L2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
--- Comment #6 from Jakub Jelinek ---
E.g. the builtin is often used in a loop where the user does his own atomic
load first and decides what to do based on that.
Say for
float f;
void
foo ()
{
#pragma omp atomic
f += 3.0f;
}
with -O2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
Jakub Jelinek changed:
What|Removed |Added
CC||redi at gcc dot gnu.org,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
--- Comment #4 from H.J. Lu ---
(In reply to Jakub Jelinek from comment #3)
> If by fail you mean that it doesn't update the memory if the memory isn't
> equal to expected, sure, but do you mean it can fail spuriously, not update
> the memory
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
H.J. Lu changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Ever confirmed|0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
--- Comment #1 from Hongyu Wang ---
__sync_val_compare_and_swap will be expanded to atomic_compare_exchange_strong
by default, should we restrict the check and return under
atomic_compare_exchange_weak which is allowed to fail spuriously?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103066
Bug ID: 103066
Summary: __sync_val_compare_and_swap/__sync_bool_compare_and_sw
ap aren't optimized
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity:
: Tue Apr 27 14:56:15 2021 +0100
arm: Fix ICEs with compare-and-swap and -march=armv8-m.base [PR99977]
The PR shows two ICEs with __sync_bool_compare_and_swap and
-mcpu=cortex-m23 (equivalently, -march=armv8-m.base): one in LRA and one
later on, after the CAS insn is split
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99977
--- Comment #8 from CVS Commits ---
The releases/gcc-11 branch has been updated by Christophe Lyon
:
https://gcc.gnu.org/g:c412100235ba34ae9c133fb7a77cc52c2e93fc87
commit r11-8435-gc412100235ba34ae9c133fb7a77cc52c2e93fc87
Author: Christophe
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99977
--- Comment #7 from CVS Commits ---
The master branch has been updated by Christophe Lyon :
https://gcc.gnu.org/g:beeb01541ae845b445837b873126a7f968b8f654
commit r12-922-gbeeb01541ae845b445837b873126a7f968b8f654
Author: Christophe Lyon
Date:
: Tue Apr 27 14:56:15 2021 +0100
arm: Fix ICEs with compare-and-swap and -march=armv8-m.base [PR99977]
The PR shows two ICEs with __sync_bool_compare_and_swap and
-mcpu=cortex-m23 (equivalently, -march=armv8-m.base): one in LRA and one
later on, after the CAS insn is split
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99977
--- Comment #5 from Alex Coplan ---
Fixed for trunk so far, needs backports.
Apr 27 14:56:15 2021 +0100
arm: Fix ICEs with compare-and-swap and -march=armv8-m.base [PR99977]
The PR shows two ICEs with __sync_bool_compare_and_swap and
-mcpu=cortex-m23 (equivalently, -march=armv8-m.base): one in LRA and one
later on, after the CAS insn is split.
The LRA
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99977
Alex Coplan changed:
What|Removed |Added
Assignee|unassigned at gcc dot gnu.org |acoplan at gcc dot
gnu.org
Last
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99977
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99977
--- Comment #1 from Alex Coplan ---
I should have mentioned the testcase was reduced from gcc.dg/ia64-sync-3.c.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99977
Bug ID: 99977
Summary: arm: ICE with __sync_bool_compare_and_swap and
-mcpu=cortex-m23
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Vieira
Date: Thu Apr 16 10:16:19 2020 +0100
re PR target/90724 (ICE with __sync_bool_compare_and_swap with
-march=armv8.2-a+sve)
2020-04-16 Andre Vieira
Backport from mainline
2019-08-21 Prathamesh Kulkarni
PR target/90724
2020-04-16 Andre Vieira
Backport from mainline
2019-08-21 Prathamesh Kulkarni
PR target/90724
* config/aarch64/aarch64.c (aarch64_gen_compare_reg_maybe_ze): Force y
in reg if it fails aarch64_plus_operand predicate.
diff --git a/gcc/config/aarch64/aarch64.c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90724
rsandifo at gcc dot gnu.org changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Kulkarni
Date: Wed Aug 21 18:34:43 2019 +
re PR target/90724 (ICE with __sync_bool_compare_and_swap with
-march=armv8.2-a+sve)
2020-02-18 Richard Sandiford
gcc/
Backport from mainline
2019-08-21 Prathamesh Kulkarni
PR target/90724
* config
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90724
Eric Gallager changed:
What|Removed |Added
Target Milestone|--- |9.4
--- Comment #4 from Eric Gallager
gt;
> > > > > > > > Hi Prathamesh
> > > > > > > >
> > > > > > > > On 7/10/19 12:24 PM, Prathamesh Kulkarni wrote:
> > > > > > > > > Hi,
> > > > > > > > > For following test-ca
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90724
--- Comment #3 from prathamesh3492 at gcc dot gnu.org ---
(In reply to Eric Gallager from comment #2)
> (In reply to prathamesh3492 from comment #1)
> > Author: prathamesh3492
> > Date: Wed Aug 21 18:34:43 2019
> > New Revision: 274805
> >
> >
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90724
--- Comment #2 from Eric Gallager ---
(In reply to prathamesh3492 from comment #1)
> Author: prathamesh3492
> Date: Wed Aug 21 18:34:43 2019
> New Revision: 274805
>
> URL: https://gcc.gnu.org/viewcvs?rev=274805=gcc=rev
> Log:
> 2019-08-21
gt; Subject: RE: PR90724 - ICE with __sync_bool_compare_and_swap with -
> march=armv8.2-a
>
> > -Original Message-
> > From: gcc-patches-ow...@gcc.gnu.org On
> > Behalf Of Prathamesh Kulkarni
> > Sent: Thursday, August 22, 2019 2:36 AM
> > To: James Greenhalgh
>
> -Original Message-
> From: gcc-patches-ow...@gcc.gnu.org On
> Behalf Of Prathamesh Kulkarni
> Sent: Thursday, August 22, 2019 2:36 AM
> To: James Greenhalgh
> Cc: gcc Patches ; Richard Sandiford
> ; Kyrill Tkachov ;
> nd
> Subject: Re: PR90724 - ICE with _
> > > > >
> > > > > > On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
> > > > > > wrote:
> > > > > > >
> > > > > > > Hi Prathamesh
> > > > > > >
> > > > > > > On 7/10/19 12:24 PM, Prathamesh
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90724
--- Comment #1 from prathamesh3492 at gcc dot gnu.org ---
Author: prathamesh3492
Date: Wed Aug 21 18:34:43 2019
New Revision: 274805
URL: https://gcc.gnu.org/viewcvs?rev=274805=gcc=rev
Log:
2019-08-21 Prathamesh Kulkarni
PR
; >
> > > > > > Hi Prathamesh
> > > > > >
> > > > > > On 7/10/19 12:24 PM, Prathamesh Kulkarni wrote:
> > > > > > > Hi,
> > > > > > > For following test-case,
> > > > > > > stati
rote:
> > > > > > Hi,
> > > > > > For following test-case,
> > > > > > static long long AL[24];
> > > > > >
> > > > > > int
> > > > > > check_ok (void)
> > > > > > {
> > >
v
> > > wrote:
> > > >
> > > > Hi Prathamesh
> > > >
> > > > On 7/10/19 12:24 PM, Prathamesh Kulkarni wrote:
> > > > > Hi,
> > > > > For following test-case,
> > > > > static long long AL[24];
> >
> On 7/10/19 12:24 PM, Prathamesh Kulkarni wrote:
> > > > Hi,
> > > > For following test-case,
> > > > static long long AL[24];
> > > >
> > > > int
> > > > check_ok (void)
> > > > {
> > > > return (__sync_bo
> static long long AL[24];
> > >
> > > int
> > > check_ok (void)
> > > {
> > > return (__sync_bool_compare_and_swap (AL+1, 0x20003ll,
> > > 0x1234567890ll));
> > > }
> > >
> > > Compilin
On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
wrote:
>
> Hi Prathamesh
>
> On 7/10/19 12:24 PM, Prathamesh Kulkarni wrote:
> > Hi,
> > For following test-case,
> > static long long AL[24];
> >
> > int
> > check_ok (void)
> > {
> >
Hi Prathamesh
On 7/10/19 12:24 PM, Prathamesh Kulkarni wrote:
Hi,
For following test-case,
static long long AL[24];
int
check_ok (void)
{
return (__sync_bool_compare_and_swap (AL+1, 0x20003ll,
0x1234567890ll));
}
Compiling with -O2 -march=armv8.2-a results in:
pr90724.c: In function
On Wed, 10 Jul 2019 at 16:54, Prathamesh Kulkarni
wrote:
>
> Hi,
> For following test-case,
> static long long AL[24];
>
> int
> check_ok (void)
> {
> return (__sync_bool_compare_and_swap (AL+1, 0x20003ll, 0x1234567890ll));
> }
>
> Compiling with -O2 -mar
Hi,
For following test-case,
static long long AL[24];
int
check_ok (void)
{
return (__sync_bool_compare_and_swap (AL+1, 0x20003ll, 0x1234567890ll));
}
Compiling with -O2 -march=armv8.2-a results in:
pr90724.c: In function ‘check_ok’:
pr90724.c:7:1: error: unrecognizable insn:
7
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90724
Bug ID: 90724
Summary: ICE with __sync_bool_compare_and_swap with
-march=armv8.2-a+sve
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58490
Richard Earnshaw changed:
What|Removed |Added
Status|WAITING |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69644
--- Comment #6 from Jakub Jelinek ---
Author: jakub
Date: Thu Feb 4 13:59:27 2016
New Revision: 233139
URL: https://gcc.gnu.org/viewcvs?rev=233139=gcc=rev
Log:
Backported from mainline
2016-02-03 Jakub Jelinek
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69644
--- Comment #5 from Jakub Jelinek ---
Author: jakub
Date: Thu Feb 4 13:58:21 2016
New Revision: 233138
URL: https://gcc.gnu.org/viewcvs?rev=233138=gcc=rev
Log:
Backported from mainline
2016-02-03 Jakub Jelinek
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69644
--- Comment #3 from Jakub Jelinek ---
Author: jakub
Date: Wed Feb 3 22:38:56 2016
New Revision: 233113
URL: https://gcc.gnu.org/viewcvs?rev=233113=gcc=rev
Log:
PR target/69644
* config/rs6000/rs6000.c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69644
Jakub Jelinek changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69644
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69644
Bug ID: 69644
Summary: ICE with -O on __sync_bool_compare_and_swap with short
in extract_insn, at recog.c:2286
Product: gcc
Version: 6.0
Status: UNCONFIRMED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69644
Martin Sebor changed:
What|Removed |Added
Target||powerpc64le-*-linux-*
Last
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58490
--- Comment #3 from Erik van der Werf erikvanderwerf at gmail dot com ---
I'm sorry, that patch definitely looks relevant, and I'd like to try it, but
somehow I did not manage to rebuild the arm-linux-gnueabi-gcc-4.7 package.
I'm not a gcc
On 09/24/2013 05:53 PM, rearnsha at gcc dot gnu.org wrote:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58490
--- Comment #2 from Richard Earnshaw rearnsha at gcc dot gnu.org ---
Can you let me know whether
http://gcc.gnu.org/ml/gcc-patches/2013-03/msg00553.html
fixes the problem?
This
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58490
--- Comment #2 from Richard Earnshaw rearnsha at gcc dot gnu.org ---
Can you let me know whether
http://gcc.gnu.org/ml/gcc-patches/2013-03/msg00553.html
fixes the problem?
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58490
Richard Earnshaw rearnsha at gcc dot gnu.org changed:
What|Removed |Added
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58490
Bug ID: 58490
Summary: __sync_bool_compare_and_swap sign bit failure
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37651
Andrew Haley aph at gcc dot gnu.org changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46682
Jakub Jelinek jakub at gcc dot gnu.org changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46682
Summary: __sync_bool_compare_and_swap generates wrong code
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo
The following example dumps a core if compiled with -march=i586 -fPIC:
#include stdint.h
int main(void)
{
static uint64_t volatile s_u64;
__sync_bool_compare_and_swap(s_u64, 0, 0);
}
The reason is that %ebx will be used as pointer for the memory variable.
I can reproduce this bug so far
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-09-25 21:36 ---
I get:
xchgl %ebx, %edi
lock ; cmpxchg8b(%esi)
xchgl %ebx, %edi
Which looks good.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37651
--- Comment #2 from brian at dessent dot net 2008-09-25 22:29 ---
Subject: Re: __sync_bool_compare_and_swap creates wrong code
with -fPIC
You get that if the variable is auto, but if it's static the reference
is with a GOTOFF reloc:
xorl%edi, %edi
pushl %ebx
I got so happy when __sync_bool_compare_and_swap showed up in 4.1 but
now HEAD have changed the behaviour for me.
Earlier I got (gcc version 4.1.2 20061028 (prerelease) (Debian
4.1.1-19)) (Yes, vendor version, but gcc.gnu.org versions did the same)
lock
cmpxchgl%edx
Magnus Fromreide writes:
I got so happy when __sync_bool_compare_and_swap showed up in 4.1 but
now HEAD have changed the behaviour for me.
Earlier I got (gcc version 4.1.2 20061028 (prerelease) (Debian
4.1.1-19)) (Yes, vendor version, but gcc.gnu.org versions did the same
On Fri, Jan 05, 2007 at 05:05:41PM +, Andrew Haley wrote:
But it can't unless you use an architecture that has cmpxchgl.
cmpxchgl is a 486 instruction; if you compile for 386, we have to
generate the call because there is no such instruction.
And the older compiler was a Debian packaged
On fre, 2007-01-05 at 17:05 +, Andrew Haley wrote:
Magnus Fromreide writes:
But it can't unless you use an architecture that has cmpxchgl.
cmpxchgl is a 486 instruction; if you compile for 386, we have to
generate the call because there is no such instruction.
Sigh - I failed to tell
On Fri, Jan 05, 2007 at 09:27:35PM +0100, Magnus Fromreide wrote:
On fre, 2007-01-05 at 17:05 +, Andrew Haley wrote:
Magnus Fromreide writes:
But it can't unless you use an architecture that has cmpxchgl.
cmpxchgl is a 486 instruction; if you compile for 386, we have to
generate
On fre, 2007-01-05 at 12:53 -0800, H. J. Lu wrote:
On Fri, Jan 05, 2007 at 09:27:35PM +0100, Magnus Fromreide wrote:
On fre, 2007-01-05 at 17:05 +, Andrew Haley wrote:
Magnus Fromreide writes:
But it can't unless you use an architecture that has cmpxchgl.
cmpxchgl is a 486
--- Additional Comments From rth at gcc dot gnu dot org 2005-04-19 16:21
---
When, exactly, did you think that cmpxchg was added? Use -march=i486. Duh.
--
What|Removed |Added
--- Additional Comments From hjl at lucon dot org 2005-04-19 16:28 ---
But there is no __sync_bool_compare_and_swap_4 in source code.
If it isn't available, shouldn't gcc leave __sync_bool_compare_and_swap
alone.
--
What|Removed |Added
--- Additional Comments From rth at gcc dot gnu dot org 2005-04-19 19:34
---
No, because __sync_bool_compare_and_swap is overloaded.
This expansion to __sync_bool_compare_and_swap_N is documented.
--
What|Removed |Added
[EMAIL PROTECTED] gcc]$ cat /tmp/x.c
#include stdio.h
#ifdef OLD
extern int __sync_bool_compare_and_swap_di (long *, long, long);
#else
#define __sync_bool_compare_and_swap_di __sync_bool_compare_and_swap
#endif
int
foo (long *x)
{
long address = *x;
if (!__sync_bool_compare_and_swap_di (x
--
What|Removed |Added
CC||rth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21097
75 matches
Mail list logo