* PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
@ 2019-07-10 11:28 Prathamesh Kulkarni
2019-07-17 7:19 ` Prathamesh Kulkarni
2019-07-17 8:18 ` Kyrill Tkachov
0 siblings, 2 replies; 13+ messages in thread
From: Prathamesh Kulkarni @ 2019-07-10 11:28 UTC (permalink / raw)
To: gcc Patches, James Greenhalgh; +Cc: Richard Sandiford
[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]
Hi,
For following test-case,
static long long AL[24];
int
check_ok (void)
{
return (__sync_bool_compare_and_swap (AL+1, 0x200000003ll, 0x1234567890ll));
}
Compiling with -O2 -march=armv8.2-a results in:
pr90724.c: In function ‘check_ok’:
pr90724.c:7:1: error: unrecognizable insn:
7 | }
| ^
(insn 11 10 12 2 (set (reg:CC 66 cc)
(compare:CC (reg:DI 95)
(const_int 8589934595 [0x200000003]))) "pr90724.c":6:11 -1
(nil))
IIUC, the issue is that 0x200000003 falls outside the range of
allowable immediate in cmp ? If it's replaced by a small constant then it works.
The ICE results with -march=armv8.2-a because, we enter if
(TARGET_LSE) { ... } condition
in aarch64_expand_compare_and_swap, while with -march=armv8.a it goes into else,
which forces oldval into register if the predicate fails to match.
The attached patch checks if y (oldval) satisfies aarch64_plus_operand
predicate and if not, forces it to be in register, which resolves ICE.
Does it look OK ?
Bootstrap+testing in progress on aarch64-linux-gnu.
PS: The issue has nothing to do with SVE, which I incorrectly
mentioned in bug report.
Thanks,
Prathamesh
[-- Attachment #2: pr90724-2.txt --]
[-- Type: text/plain, Size: 617 bytes --]
2019-07-10 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
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 b/gcc/config/aarch64/aarch64.c
index a18fbd0f0aa..22d4726e19a 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -1930,6 +1930,9 @@ aarch64_gen_compare_reg_maybe_ze (RTX_CODE code, rtx x, rtx y,
}
}
+ if (!aarch64_plus_operand (y, y_mode))
+ y = force_reg (y_mode, y);
+
return aarch64_gen_compare_reg (code, x, y);
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-07-10 11:28 PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a Prathamesh Kulkarni
@ 2019-07-17 7:19 ` Prathamesh Kulkarni
2019-07-17 8:18 ` Kyrill Tkachov
1 sibling, 0 replies; 13+ messages in thread
From: Prathamesh Kulkarni @ 2019-07-17 7:19 UTC (permalink / raw)
To: gcc Patches, James Greenhalgh; +Cc: Richard Sandiford
On Wed, 10 Jul 2019 at 16:54, Prathamesh Kulkarni
<prathamesh.kulkarni@linaro.org> wrote:
>
> Hi,
> For following test-case,
> static long long AL[24];
>
> int
> check_ok (void)
> {
> return (__sync_bool_compare_and_swap (AL+1, 0x200000003ll, 0x1234567890ll));
> }
>
> Compiling with -O2 -march=armv8.2-a results in:
> pr90724.c: In function ‘check_ok’:
> pr90724.c:7:1: error: unrecognizable insn:
> 7 | }
> | ^
> (insn 11 10 12 2 (set (reg:CC 66 cc)
> (compare:CC (reg:DI 95)
> (const_int 8589934595 [0x200000003]))) "pr90724.c":6:11 -1
> (nil))
>
> IIUC, the issue is that 0x200000003 falls outside the range of
> allowable immediate in cmp ? If it's replaced by a small constant then it works.
>
> The ICE results with -march=armv8.2-a because, we enter if
> (TARGET_LSE) { ... } condition
> in aarch64_expand_compare_and_swap, while with -march=armv8.a it goes into else,
> which forces oldval into register if the predicate fails to match.
>
> The attached patch checks if y (oldval) satisfies aarch64_plus_operand
> predicate and if not, forces it to be in register, which resolves ICE.
> Does it look OK ?
>
> Bootstrap+testing in progress on aarch64-linux-gnu.
ping https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
Thanks,
Prathamesh
>
> PS: The issue has nothing to do with SVE, which I incorrectly
> mentioned in bug report.
>
> Thanks,
> Prathamesh
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-07-10 11:28 PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a Prathamesh Kulkarni
2019-07-17 7:19 ` Prathamesh Kulkarni
@ 2019-07-17 8:18 ` Kyrill Tkachov
2019-07-17 13:40 ` Prathamesh Kulkarni
1 sibling, 1 reply; 13+ messages in thread
From: Kyrill Tkachov @ 2019-07-17 8:18 UTC (permalink / raw)
To: Prathamesh Kulkarni, gcc Patches, James Greenhalgh; +Cc: Richard Sandiford
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, 0x200000003ll,
> 0x1234567890ll));
> }
>
> Compiling with -O2 -march=armv8.2-a results in:
> pr90724.c: In function âcheck_okâ:
> pr90724.c:7:1: error: unrecognizable insn:
> Â Â Â 7 | }
> Â Â Â Â Â | ^
> (insn 11 10 12 2 (set (reg:CC 66 cc)
> Â Â Â Â Â Â Â (compare:CC (reg:DI 95)
> Â Â Â Â Â Â Â Â Â Â Â (const_int 8589934595 [0x200000003]))) "pr90724.c":6:11 -1
> Â Â Â Â (nil))
>
> IIUC, the issue is that 0x200000003 falls outside the range of
> allowable immediate in cmp ? If it's replaced by a small constant then
> it works.
>
> The ICE results with -march=armv8.2-a because, we enter if
> (TARGET_LSE) { ... } condition
> in aarch64_expand_compare_and_swap, while with -march=armv8.a it goes
> into else,
> which forces oldval into register if the predicate fails to match.
>
> The attached patch checks if y (oldval) satisfies aarch64_plus_operand
> predicate and if not, forces it to be in register, which resolves ICE.
> Does it look OK ?
>
> Bootstrap+testing in progress on aarch64-linux-gnu.
>
> PS: The issue has nothing to do with SVE, which I incorrectly
> mentioned in bug report.
>
This looks ok to me (but you'll need maintainer approval).
Does this fail on the branches as well?
Thanks,
Kyrill
> Thanks,
> Prathamesh
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-07-17 8:18 ` Kyrill Tkachov
@ 2019-07-17 13:40 ` Prathamesh Kulkarni
2019-07-25 7:50 ` Prathamesh Kulkarni
0 siblings, 1 reply; 13+ messages in thread
From: Prathamesh Kulkarni @ 2019-07-17 13:40 UTC (permalink / raw)
To: Kyrill Tkachov; +Cc: gcc Patches, James Greenhalgh, Richard Sandiford
On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
<kyrylo.tkachov@foss.arm.com> 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)
> > {
> > return (__sync_bool_compare_and_swap (AL+1, 0x200000003ll,
> > 0x1234567890ll));
> > }
> >
> > Compiling with -O2 -march=armv8.2-a results in:
> > pr90724.c: In function ‘check_ok’:
> > pr90724.c:7:1: error: unrecognizable insn:
> > 7 | }
> > | ^
> > (insn 11 10 12 2 (set (reg:CC 66 cc)
> > (compare:CC (reg:DI 95)
> > (const_int 8589934595 [0x200000003]))) "pr90724.c":6:11 -1
> > (nil))
> >
> > IIUC, the issue is that 0x200000003 falls outside the range of
> > allowable immediate in cmp ? If it's replaced by a small constant then
> > it works.
> >
> > The ICE results with -march=armv8.2-a because, we enter if
> > (TARGET_LSE) { ... } condition
> > in aarch64_expand_compare_and_swap, while with -march=armv8.a it goes
> > into else,
> > which forces oldval into register if the predicate fails to match.
> >
> > The attached patch checks if y (oldval) satisfies aarch64_plus_operand
> > predicate and if not, forces it to be in register, which resolves ICE.
> > Does it look OK ?
> >
> > Bootstrap+testing in progress on aarch64-linux-gnu.
> >
> > PS: The issue has nothing to do with SVE, which I incorrectly
> > mentioned in bug report.
> >
> This looks ok to me (but you'll need maintainer approval).
>
> Does this fail on the branches as well?
Hi Kyrill,
Thanks for the review. The test also fails on gcc-9-branch (but not on gcc-8).
Thanks,
Prathamesh
>
> Thanks,
>
> Kyrill
>
>
> > Thanks,
> > Prathamesh
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-07-17 13:40 ` Prathamesh Kulkarni
@ 2019-07-25 7:50 ` Prathamesh Kulkarni
2019-08-01 10:04 ` Prathamesh Kulkarni
0 siblings, 1 reply; 13+ messages in thread
From: Prathamesh Kulkarni @ 2019-07-25 7:50 UTC (permalink / raw)
To: James Greenhalgh; +Cc: gcc Patches, Richard Sandiford, Kyrill Tkachov
On Wed, 17 Jul 2019 at 18:15, Prathamesh Kulkarni
<prathamesh.kulkarni@linaro.org> wrote:
>
> On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
> <kyrylo.tkachov@foss.arm.com> 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)
> > > {
> > > return (__sync_bool_compare_and_swap (AL+1, 0x200000003ll,
> > > 0x1234567890ll));
> > > }
> > >
> > > Compiling with -O2 -march=armv8.2-a results in:
> > > pr90724.c: In function ‘check_ok’:
> > > pr90724.c:7:1: error: unrecognizable insn:
> > > 7 | }
> > > | ^
> > > (insn 11 10 12 2 (set (reg:CC 66 cc)
> > > (compare:CC (reg:DI 95)
> > > (const_int 8589934595 [0x200000003]))) "pr90724.c":6:11 -1
> > > (nil))
> > >
> > > IIUC, the issue is that 0x200000003 falls outside the range of
> > > allowable immediate in cmp ? If it's replaced by a small constant then
> > > it works.
> > >
> > > The ICE results with -march=armv8.2-a because, we enter if
> > > (TARGET_LSE) { ... } condition
> > > in aarch64_expand_compare_and_swap, while with -march=armv8.a it goes
> > > into else,
> > > which forces oldval into register if the predicate fails to match.
> > >
> > > The attached patch checks if y (oldval) satisfies aarch64_plus_operand
> > > predicate and if not, forces it to be in register, which resolves ICE.
> > > Does it look OK ?
> > >
> > > Bootstrap+testing in progress on aarch64-linux-gnu.
> > >
> > > PS: The issue has nothing to do with SVE, which I incorrectly
> > > mentioned in bug report.
> > >
> > This looks ok to me (but you'll need maintainer approval).
> >
> > Does this fail on the branches as well?
> Hi Kyrill,
> Thanks for the review. The test also fails on gcc-9-branch (but not on gcc-8).
Hi James,
Is the patch OK to commit ?
https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
Thanks,
Prathamesh
>
> Thanks,
> Prathamesh
> >
> > Thanks,
> >
> > Kyrill
> >
> >
> > > Thanks,
> > > Prathamesh
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-07-25 7:50 ` Prathamesh Kulkarni
@ 2019-08-01 10:04 ` Prathamesh Kulkarni
2019-08-08 6:31 ` Prathamesh Kulkarni
0 siblings, 1 reply; 13+ messages in thread
From: Prathamesh Kulkarni @ 2019-08-01 10:04 UTC (permalink / raw)
To: James Greenhalgh; +Cc: gcc Patches, Richard Sandiford, Kyrill Tkachov
On Thu, 25 Jul 2019 at 11:56, Prathamesh Kulkarni
<prathamesh.kulkarni@linaro.org> wrote:
>
> On Wed, 17 Jul 2019 at 18:15, Prathamesh Kulkarni
> <prathamesh.kulkarni@linaro.org> wrote:
> >
> > On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
> > <kyrylo.tkachov@foss.arm.com> 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)
> > > > {
> > > > return (__sync_bool_compare_and_swap (AL+1, 0x200000003ll,
> > > > 0x1234567890ll));
> > > > }
> > > >
> > > > Compiling with -O2 -march=armv8.2-a results in:
> > > > pr90724.c: In function ‘check_ok’:
> > > > pr90724.c:7:1: error: unrecognizable insn:
> > > > 7 | }
> > > > | ^
> > > > (insn 11 10 12 2 (set (reg:CC 66 cc)
> > > > (compare:CC (reg:DI 95)
> > > > (const_int 8589934595 [0x200000003]))) "pr90724.c":6:11 -1
> > > > (nil))
> > > >
> > > > IIUC, the issue is that 0x200000003 falls outside the range of
> > > > allowable immediate in cmp ? If it's replaced by a small constant then
> > > > it works.
> > > >
> > > > The ICE results with -march=armv8.2-a because, we enter if
> > > > (TARGET_LSE) { ... } condition
> > > > in aarch64_expand_compare_and_swap, while with -march=armv8.a it goes
> > > > into else,
> > > > which forces oldval into register if the predicate fails to match.
> > > >
> > > > The attached patch checks if y (oldval) satisfies aarch64_plus_operand
> > > > predicate and if not, forces it to be in register, which resolves ICE.
> > > > Does it look OK ?
> > > >
> > > > Bootstrap+testing in progress on aarch64-linux-gnu.
> > > >
> > > > PS: The issue has nothing to do with SVE, which I incorrectly
> > > > mentioned in bug report.
> > > >
> > > This looks ok to me (but you'll need maintainer approval).
> > >
> > > Does this fail on the branches as well?
> > Hi Kyrill,
> > Thanks for the review. The test also fails on gcc-9-branch (but not on gcc-8).
> Hi James,
> Is the patch OK to commit ?
> https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
ping * 3: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
Thanks,
Prathamesh
>
> Thanks,
> Prathamesh
> >
> > Thanks,
> > Prathamesh
> > >
> > > Thanks,
> > >
> > > Kyrill
> > >
> > >
> > > > Thanks,
> > > > Prathamesh
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-08-01 10:04 ` Prathamesh Kulkarni
@ 2019-08-08 6:31 ` Prathamesh Kulkarni
2019-08-15 13:30 ` Prathamesh Kulkarni
0 siblings, 1 reply; 13+ messages in thread
From: Prathamesh Kulkarni @ 2019-08-08 6:31 UTC (permalink / raw)
To: James Greenhalgh; +Cc: gcc Patches, Richard Sandiford, Kyrill Tkachov
On Thu, 1 Aug 2019 at 15:34, Prathamesh Kulkarni
<prathamesh.kulkarni@linaro.org> wrote:
>
> On Thu, 25 Jul 2019 at 11:56, Prathamesh Kulkarni
> <prathamesh.kulkarni@linaro.org> wrote:
> >
> > On Wed, 17 Jul 2019 at 18:15, Prathamesh Kulkarni
> > <prathamesh.kulkarni@linaro.org> wrote:
> > >
> > > On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
> > > <kyrylo.tkachov@foss.arm.com> 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)
> > > > > {
> > > > > return (__sync_bool_compare_and_swap (AL+1, 0x200000003ll,
> > > > > 0x1234567890ll));
> > > > > }
> > > > >
> > > > > Compiling with -O2 -march=armv8.2-a results in:
> > > > > pr90724.c: In function ‘check_ok’:
> > > > > pr90724.c:7:1: error: unrecognizable insn:
> > > > > 7 | }
> > > > > | ^
> > > > > (insn 11 10 12 2 (set (reg:CC 66 cc)
> > > > > (compare:CC (reg:DI 95)
> > > > > (const_int 8589934595 [0x200000003]))) "pr90724.c":6:11 -1
> > > > > (nil))
> > > > >
> > > > > IIUC, the issue is that 0x200000003 falls outside the range of
> > > > > allowable immediate in cmp ? If it's replaced by a small constant then
> > > > > it works.
> > > > >
> > > > > The ICE results with -march=armv8.2-a because, we enter if
> > > > > (TARGET_LSE) { ... } condition
> > > > > in aarch64_expand_compare_and_swap, while with -march=armv8.a it goes
> > > > > into else,
> > > > > which forces oldval into register if the predicate fails to match.
> > > > >
> > > > > The attached patch checks if y (oldval) satisfies aarch64_plus_operand
> > > > > predicate and if not, forces it to be in register, which resolves ICE.
> > > > > Does it look OK ?
> > > > >
> > > > > Bootstrap+testing in progress on aarch64-linux-gnu.
> > > > >
> > > > > PS: The issue has nothing to do with SVE, which I incorrectly
> > > > > mentioned in bug report.
> > > > >
> > > > This looks ok to me (but you'll need maintainer approval).
> > > >
> > > > Does this fail on the branches as well?
> > > Hi Kyrill,
> > > Thanks for the review. The test also fails on gcc-9-branch (but not on gcc-8).
> > Hi James,
> > Is the patch OK to commit ?
> > https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> ping * 3: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
ping * 4: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
Thanks,
Prathamesh
>
> Thanks,
> Prathamesh
> >
> > Thanks,
> > Prathamesh
> > >
> > > Thanks,
> > > Prathamesh
> > > >
> > > > Thanks,
> > > >
> > > > Kyrill
> > > >
> > > >
> > > > > Thanks,
> > > > > Prathamesh
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-08-08 6:31 ` Prathamesh Kulkarni
@ 2019-08-15 13:30 ` Prathamesh Kulkarni
2019-08-19 18:34 ` James Greenhalgh
0 siblings, 1 reply; 13+ messages in thread
From: Prathamesh Kulkarni @ 2019-08-15 13:30 UTC (permalink / raw)
To: James Greenhalgh; +Cc: gcc Patches, Richard Sandiford, Kyrill Tkachov
On Thu, 8 Aug 2019 at 11:22, Prathamesh Kulkarni
<prathamesh.kulkarni@linaro.org> wrote:
>
> On Thu, 1 Aug 2019 at 15:34, Prathamesh Kulkarni
> <prathamesh.kulkarni@linaro.org> wrote:
> >
> > On Thu, 25 Jul 2019 at 11:56, Prathamesh Kulkarni
> > <prathamesh.kulkarni@linaro.org> wrote:
> > >
> > > On Wed, 17 Jul 2019 at 18:15, Prathamesh Kulkarni
> > > <prathamesh.kulkarni@linaro.org> wrote:
> > > >
> > > > On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
> > > > <kyrylo.tkachov@foss.arm.com> 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)
> > > > > > {
> > > > > > return (__sync_bool_compare_and_swap (AL+1, 0x200000003ll,
> > > > > > 0x1234567890ll));
> > > > > > }
> > > > > >
> > > > > > Compiling with -O2 -march=armv8.2-a results in:
> > > > > > pr90724.c: In function ‘check_ok’:
> > > > > > pr90724.c:7:1: error: unrecognizable insn:
> > > > > > 7 | }
> > > > > > | ^
> > > > > > (insn 11 10 12 2 (set (reg:CC 66 cc)
> > > > > > (compare:CC (reg:DI 95)
> > > > > > (const_int 8589934595 [0x200000003]))) "pr90724.c":6:11 -1
> > > > > > (nil))
> > > > > >
> > > > > > IIUC, the issue is that 0x200000003 falls outside the range of
> > > > > > allowable immediate in cmp ? If it's replaced by a small constant then
> > > > > > it works.
> > > > > >
> > > > > > The ICE results with -march=armv8.2-a because, we enter if
> > > > > > (TARGET_LSE) { ... } condition
> > > > > > in aarch64_expand_compare_and_swap, while with -march=armv8.a it goes
> > > > > > into else,
> > > > > > which forces oldval into register if the predicate fails to match.
> > > > > >
> > > > > > The attached patch checks if y (oldval) satisfies aarch64_plus_operand
> > > > > > predicate and if not, forces it to be in register, which resolves ICE.
> > > > > > Does it look OK ?
> > > > > >
> > > > > > Bootstrap+testing in progress on aarch64-linux-gnu.
> > > > > >
> > > > > > PS: The issue has nothing to do with SVE, which I incorrectly
> > > > > > mentioned in bug report.
> > > > > >
> > > > > This looks ok to me (but you'll need maintainer approval).
> > > > >
> > > > > Does this fail on the branches as well?
> > > > Hi Kyrill,
> > > > Thanks for the review. The test also fails on gcc-9-branch (but not on gcc-8).
> > > Hi James,
> > > Is the patch OK to commit ?
> > > https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > ping * 3: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> ping * 4: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
ping * 5: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
Thanks,
Prathamesh
>
> Thanks,
> Prathamesh
> >
> > Thanks,
> > Prathamesh
> > >
> > > Thanks,
> > > Prathamesh
> > > >
> > > > Thanks,
> > > > Prathamesh
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Kyrill
> > > > >
> > > > >
> > > > > > Thanks,
> > > > > > Prathamesh
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-08-15 13:30 ` Prathamesh Kulkarni
@ 2019-08-19 18:34 ` James Greenhalgh
2019-08-21 20:48 ` Prathamesh Kulkarni
0 siblings, 1 reply; 13+ messages in thread
From: James Greenhalgh @ 2019-08-19 18:34 UTC (permalink / raw)
To: Prathamesh Kulkarni; +Cc: gcc Patches, Richard Sandiford, Kyrill Tkachov, nd
On Thu, Aug 15, 2019 at 02:11:25PM +0100, Prathamesh Kulkarni wrote:
> On Thu, 8 Aug 2019 at 11:22, Prathamesh Kulkarni
> <prathamesh.kulkarni@linaro.org> wrote:
> >
> > On Thu, 1 Aug 2019 at 15:34, Prathamesh Kulkarni
> > <prathamesh.kulkarni@linaro.org> wrote:
> > >
> > > On Thu, 25 Jul 2019 at 11:56, Prathamesh Kulkarni
> > > <prathamesh.kulkarni@linaro.org> wrote:
> > > >
> > > > On Wed, 17 Jul 2019 at 18:15, Prathamesh Kulkarni
> > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > >
> > > > > On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
> > > > > <kyrylo.tkachov@foss.arm.com> 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)
> > > > > > > {
> > > > > > > return (__sync_bool_compare_and_swap (AL+1, 0x200000003ll,
> > > > > > > 0x1234567890ll));
> > > > > > > }
> > > > > > >
> > > > > > > Compiling with -O2 -march=armv8.2-a results in:
> > > > > > > pr90724.c: In function âcheck_okâ:
> > > > > > > pr90724.c:7:1: error: unrecognizable insn:
> > > > > > > 7 | }
> > > > > > > | ^
> > > > > > > (insn 11 10 12 2 (set (reg:CC 66 cc)
> > > > > > > (compare:CC (reg:DI 95)
> > > > > > > (const_int 8589934595 [0x200000003]))) "pr90724.c":6:11 -1
> > > > > > > (nil))
> > > > > > >
> > > > > > > IIUC, the issue is that 0x200000003 falls outside the range of
> > > > > > > allowable immediate in cmp ? If it's replaced by a small constant then
> > > > > > > it works.
> > > > > > >
> > > > > > > The ICE results with -march=armv8.2-a because, we enter if
> > > > > > > (TARGET_LSE) { ... } condition
> > > > > > > in aarch64_expand_compare_and_swap, while with -march=armv8.a it goes
> > > > > > > into else,
> > > > > > > which forces oldval into register if the predicate fails to match.
> > > > > > >
> > > > > > > The attached patch checks if y (oldval) satisfies aarch64_plus_operand
> > > > > > > predicate and if not, forces it to be in register, which resolves ICE.
> > > > > > > Does it look OK ?
> > > > > > >
> > > > > > > Bootstrap+testing in progress on aarch64-linux-gnu.
> > > > > > >
> > > > > > > PS: The issue has nothing to do with SVE, which I incorrectly
> > > > > > > mentioned in bug report.
> > > > > > >
> > > > > > This looks ok to me (but you'll need maintainer approval).
> > > > > >
> > > > > > Does this fail on the branches as well?
> > > > > Hi Kyrill,
> > > > > Thanks for the review. The test also fails on gcc-9-branch (but not on gcc-8).
> > > > Hi James,
> > > > Is the patch OK to commit ?
> > > > https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > ping * 3: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > ping * 4: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> ping * 5: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
Hi,
Sorry, this missed my filters as it didn't mention AArch64 in the subject
line.
Thais is good for trunk, thanks for waiting.
James
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-08-19 18:34 ` James Greenhalgh
@ 2019-08-21 20:48 ` Prathamesh Kulkarni
2019-08-22 3:18 ` JiangNing OS
2019-09-09 19:07 ` Prathamesh Kulkarni
0 siblings, 2 replies; 13+ messages in thread
From: Prathamesh Kulkarni @ 2019-08-21 20:48 UTC (permalink / raw)
To: James Greenhalgh; +Cc: gcc Patches, Richard Sandiford, Kyrill Tkachov, nd
On Mon, 19 Aug 2019 at 22:14, James Greenhalgh <james.greenhalgh@arm.com> wrote:
>
> On Thu, Aug 15, 2019 at 02:11:25PM +0100, Prathamesh Kulkarni wrote:
> > On Thu, 8 Aug 2019 at 11:22, Prathamesh Kulkarni
> > <prathamesh.kulkarni@linaro.org> wrote:
> > >
> > > On Thu, 1 Aug 2019 at 15:34, Prathamesh Kulkarni
> > > <prathamesh.kulkarni@linaro.org> wrote:
> > > >
> > > > On Thu, 25 Jul 2019 at 11:56, Prathamesh Kulkarni
> > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > >
> > > > > On Wed, 17 Jul 2019 at 18:15, Prathamesh Kulkarni
> > > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > > >
> > > > > > On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
> > > > > > <kyrylo.tkachov@foss.arm.com> 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)
> > > > > > > > {
> > > > > > > > return (__sync_bool_compare_and_swap (AL+1, 0x200000003ll,
> > > > > > > > 0x1234567890ll));
> > > > > > > > }
> > > > > > > >
> > > > > > > > Compiling with -O2 -march=armv8.2-a results in:
> > > > > > > > pr90724.c: In function ‘check_ok’:
> > > > > > > > pr90724.c:7:1: error: unrecognizable insn:
> > > > > > > > 7 | }
> > > > > > > > | ^
> > > > > > > > (insn 11 10 12 2 (set (reg:CC 66 cc)
> > > > > > > > (compare:CC (reg:DI 95)
> > > > > > > > (const_int 8589934595 [0x200000003]))) "pr90724.c":6:11 -1
> > > > > > > > (nil))
> > > > > > > >
> > > > > > > > IIUC, the issue is that 0x200000003 falls outside the range of
> > > > > > > > allowable immediate in cmp ? If it's replaced by a small constant then
> > > > > > > > it works.
> > > > > > > >
> > > > > > > > The ICE results with -march=armv8.2-a because, we enter if
> > > > > > > > (TARGET_LSE) { ... } condition
> > > > > > > > in aarch64_expand_compare_and_swap, while with -march=armv8.a it goes
> > > > > > > > into else,
> > > > > > > > which forces oldval into register if the predicate fails to match.
> > > > > > > >
> > > > > > > > The attached patch checks if y (oldval) satisfies aarch64_plus_operand
> > > > > > > > predicate and if not, forces it to be in register, which resolves ICE.
> > > > > > > > Does it look OK ?
> > > > > > > >
> > > > > > > > Bootstrap+testing in progress on aarch64-linux-gnu.
> > > > > > > >
> > > > > > > > PS: The issue has nothing to do with SVE, which I incorrectly
> > > > > > > > mentioned in bug report.
> > > > > > > >
> > > > > > > This looks ok to me (but you'll need maintainer approval).
> > > > > > >
> > > > > > > Does this fail on the branches as well?
> > > > > > Hi Kyrill,
> > > > > > Thanks for the review. The test also fails on gcc-9-branch (but not on gcc-8).
> > > > > Hi James,
> > > > > Is the patch OK to commit ?
> > > > > https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > > ping * 3: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > ping * 4: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > ping * 5: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
>
> Hi,
>
> Sorry, this missed my filters as it didn't mention AArch64 in the subject
> line.
>
> Thais is good for trunk, thanks for waiting.
Thanks, committed to trunk in r274805.
Is this OK to backport to gcc-9-branch ?
Thanks,
Prathamesh
>
> James
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-08-21 20:48 ` Prathamesh Kulkarni
@ 2019-08-22 3:18 ` JiangNing OS
2019-08-22 3:36 ` JiangNing OS
2019-09-09 19:07 ` Prathamesh Kulkarni
1 sibling, 1 reply; 13+ messages in thread
From: JiangNing OS @ 2019-08-22 3:18 UTC (permalink / raw)
To: Prathamesh Kulkarni, James Greenhalgh
Cc: gcc Patches, Richard Sandiford, Kyrill Tkachov, nd
> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org <gcc-patches-owner@gcc.gnu.org> On
> Behalf Of Prathamesh Kulkarni
> Sent: Thursday, August 22, 2019 2:36 AM
> To: James Greenhalgh <james.greenhalgh@arm.com>
> Cc: gcc Patches <gcc-patches@gcc.gnu.org>; Richard Sandiford
> <Richard.Sandiford@arm.com>; Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>;
> nd <nd@arm.com>
> Subject: Re: PR90724 - ICE with __sync_bool_compare_and_swap with -
> march=armv8.2-a
>
> On Mon, 19 Aug 2019 at 22:14, James Greenhalgh
> <james.greenhalgh@arm.com> wrote:
> >
> > On Thu, Aug 15, 2019 at 02:11:25PM +0100, Prathamesh Kulkarni wrote:
> > > On Thu, 8 Aug 2019 at 11:22, Prathamesh Kulkarni
> > > <prathamesh.kulkarni@linaro.org> wrote:
> > > >
> > > > On Thu, 1 Aug 2019 at 15:34, Prathamesh Kulkarni
> > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > >
> > > > > On Thu, 25 Jul 2019 at 11:56, Prathamesh Kulkarni
> > > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > > >
> > > > > > On Wed, 17 Jul 2019 at 18:15, Prathamesh Kulkarni
> > > > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > > > >
> > > > > > > On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
> > > > > > > <kyrylo.tkachov@foss.arm.com> 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)
> > > > > > > > > {
> > > > > > > > > return (__sync_bool_compare_and_swap (AL+1,
> > > > > > > > > 0x200000003ll, 0x1234567890ll)); }
> > > > > > > > >
> > > > > > > > > Compiling with -O2 -march=armv8.2-a results in:
> > > > > > > > > pr90724.c: In function ‘check_ok’:
> > > > > > > > > pr90724.c:7:1: error: unrecognizable insn:
> > > > > > > > > 7 | }
> > > > > > > > > | ^
> > > > > > > > > (insn 11 10 12 2 (set (reg:CC 66 cc)
> > > > > > > > > (compare:CC (reg:DI 95)
> > > > > > > > > (const_int 8589934595 [0x200000003])))
> "pr90724.c":6:11 -1
> > > > > > > > > (nil))
> > > > > > > > >
> > > > > > > > > IIUC, the issue is that 0x200000003 falls outside the
> > > > > > > > > range of allowable immediate in cmp ? If it's replaced
> > > > > > > > > by a small constant then it works.
> > > > > > > > >
> > > > > > > > > The ICE results with -march=armv8.2-a because, we enter
> > > > > > > > > if
> > > > > > > > > (TARGET_LSE) { ... } condition in
> > > > > > > > > aarch64_expand_compare_and_swap, while with
> > > > > > > > > -march=armv8.a it goes into else, which forces oldval
> > > > > > > > > into register if the predicate fails to match.
> > > > > > > > >
> > > > > > > > > The attached patch checks if y (oldval) satisfies
> > > > > > > > > aarch64_plus_operand predicate and if not, forces it to be in
> register, which resolves ICE.
> > > > > > > > > Does it look OK ?
> > > > > > > > >
> > > > > > > > > Bootstrap+testing in progress on aarch64-linux-gnu.
> > > > > > > > >
> > > > > > > > > PS: The issue has nothing to do with SVE, which I
> > > > > > > > > incorrectly mentioned in bug report.
> > > > > > > > >
> > > > > > > > This looks ok to me (but you'll need maintainer approval).
> > > > > > > >
> > > > > > > > Does this fail on the branches as well?
> > > > > > > Hi Kyrill,
> > > > > > > Thanks for the review. The test also fails on gcc-9-branch (but not on
> gcc-8).
> > > > > > Hi James,
> > > > > > Is the patch OK to commit ?
> > > > > > https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > > > ping * 3:
> > > > > https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > > ping * 4: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > ping * 5: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> >
> > Hi,
> >
> > Sorry, this missed my filters as it didn't mention AArch64 in the
> > subject line.
> >
> > Thais is good for trunk, thanks for waiting.
> Thanks, committed to trunk in r274805.
Trunk aarch64 build failure is exposed by this commit.
../../gcc/gcc/config/aarch64/aarch64.c: In function ���bool aarch64_evpc_sel(expand_vec_perm_d*)���:
../../gcc/gcc/config/aarch64/aarch64.c:18018:75: error: ���gen_vcond_mask��� was not declared in this scope
emit_insn (gen_vcond_mask (vmode, vmode, d->target, d->op1, d->op0, pred));
^
make[3]: *** [aarch64.o] Error 1
make[3]: Leaving directory `/home/amptest/gcc/build/gcc'
> Is this OK to backport to gcc-9-branch ?
>
> Thanks,
> Prathamesh
> >
> > James
> >
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-08-22 3:18 ` JiangNing OS
@ 2019-08-22 3:36 ` JiangNing OS
0 siblings, 0 replies; 13+ messages in thread
From: JiangNing OS @ 2019-08-22 3:36 UTC (permalink / raw)
To: JiangNing OS, Prathamesh Kulkarni, James Greenhalgh
Cc: gcc Patches, Richard Sandiford, Kyrill Tkachov, nd
> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org <gcc-patches-owner@gcc.gnu.org> On
> Behalf Of JiangNing OS
> Sent: Thursday, August 22, 2019 8:24 AM
> To: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>; James Greenhalgh
> <james.greenhalgh@arm.com>
> Cc: gcc Patches <gcc-patches@gcc.gnu.org>; Richard Sandiford
> <Richard.Sandiford@arm.com>; Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>;
> nd <nd@arm.com>
> Subject: RE: PR90724 - ICE with __sync_bool_compare_and_swap with -
> march=armv8.2-a
>
> > -----Original Message-----
> > From: gcc-patches-owner@gcc.gnu.org <gcc-patches-owner@gcc.gnu.org> On
> > Behalf Of Prathamesh Kulkarni
> > Sent: Thursday, August 22, 2019 2:36 AM
> > To: James Greenhalgh <james.greenhalgh@arm.com>
> > Cc: gcc Patches <gcc-patches@gcc.gnu.org>; Richard Sandiford
> > <Richard.Sandiford@arm.com>; Kyrill Tkachov
> > <kyrylo.tkachov@foss.arm.com>; nd <nd@arm.com>
> > Subject: Re: PR90724 - ICE with __sync_bool_compare_and_swap with -
> > march=armv8.2-a
> >
> > On Mon, 19 Aug 2019 at 22:14, James Greenhalgh
> > <james.greenhalgh@arm.com> wrote:
> > >
> > > On Thu, Aug 15, 2019 at 02:11:25PM +0100, Prathamesh Kulkarni wrote:
> > > > On Thu, 8 Aug 2019 at 11:22, Prathamesh Kulkarni
> > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > >
> > > > > On Thu, 1 Aug 2019 at 15:34, Prathamesh Kulkarni
> > > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > > >
> > > > > > On Thu, 25 Jul 2019 at 11:56, Prathamesh Kulkarni
> > > > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > > > >
> > > > > > > On Wed, 17 Jul 2019 at 18:15, Prathamesh Kulkarni
> > > > > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > > > > >
> > > > > > > > On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
> > > > > > > > <kyrylo.tkachov@foss.arm.com> 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)
> > > > > > > > > > {
> > > > > > > > > > return (__sync_bool_compare_and_swap (AL+1,
> > > > > > > > > > 0x200000003ll, 0x1234567890ll)); }
> > > > > > > > > >
> > > > > > > > > > Compiling with -O2 -march=armv8.2-a results in:
> > > > > > > > > > pr90724.c: In function ‘check_ok’:
> > > > > > > > > > pr90724.c:7:1: error: unrecognizable insn:
> > > > > > > > > > 7 | }
> > > > > > > > > > | ^
> > > > > > > > > > (insn 11 10 12 2 (set (reg:CC 66 cc)
> > > > > > > > > > (compare:CC (reg:DI 95)
> > > > > > > > > > (const_int 8589934595 [0x200000003])))
> > "pr90724.c":6:11 -1
> > > > > > > > > > (nil))
> > > > > > > > > >
> > > > > > > > > > IIUC, the issue is that 0x200000003 falls outside the
> > > > > > > > > > range of allowable immediate in cmp ? If it's replaced
> > > > > > > > > > by a small constant then it works.
> > > > > > > > > >
> > > > > > > > > > The ICE results with -march=armv8.2-a because, we
> > > > > > > > > > enter if
> > > > > > > > > > (TARGET_LSE) { ... } condition in
> > > > > > > > > > aarch64_expand_compare_and_swap, while with
> > > > > > > > > > -march=armv8.a it goes into else, which forces oldval
> > > > > > > > > > into register if the predicate fails to match.
> > > > > > > > > >
> > > > > > > > > > The attached patch checks if y (oldval) satisfies
> > > > > > > > > > aarch64_plus_operand predicate and if not, forces it
> > > > > > > > > > to be in
> > register, which resolves ICE.
> > > > > > > > > > Does it look OK ?
> > > > > > > > > >
> > > > > > > > > > Bootstrap+testing in progress on aarch64-linux-gnu.
> > > > > > > > > >
> > > > > > > > > > PS: The issue has nothing to do with SVE, which I
> > > > > > > > > > incorrectly mentioned in bug report.
> > > > > > > > > >
> > > > > > > > > This looks ok to me (but you'll need maintainer approval).
> > > > > > > > >
> > > > > > > > > Does this fail on the branches as well?
> > > > > > > > Hi Kyrill,
> > > > > > > > Thanks for the review. The test also fails on gcc-9-branch
> > > > > > > > (but not on
> > gcc-8).
> > > > > > > Hi James,
> > > > > > > Is the patch OK to commit ?
> > > > > > > https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > > > > ping * 3:
> > > > > > https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > > > ping * 4:
> > > > > https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > > ping * 5: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > >
> > > Hi,
> > >
> > > Sorry, this missed my filters as it didn't mention AArch64 in the
> > > subject line.
> > >
> > > Thais is good for trunk, thanks for waiting.
> > Thanks, committed to trunk in r274805.
>
> Trunk aarch64 build failure is exposed by this commit.
>
> ../../gcc/gcc/config/aarch64/aarch64.c: In function bool
> aarch64_evpc_sel(expand_vec_perm_d*) :
> ../../gcc/gcc/config/aarch64/aarch64.c:18018:75: error: gen_vcond_mask
> was not declared in this scope
> emit_insn (gen_vcond_mask (vmode, vmode, d->target, d->op1, d->op0,
> pred));
> ^
> make[3]: *** [aarch64.o] Error 1
> make[3]: Leaving directory `/home/amptest/gcc/build/gcc'
Oh. It is caused by a different commit 274810 rather than 274805.
>
> > Is this OK to backport to gcc-9-branch ?
> >
> > Thanks,
> > Prathamesh
> > >
> > > James
> > >
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a
2019-08-21 20:48 ` Prathamesh Kulkarni
2019-08-22 3:18 ` JiangNing OS
@ 2019-09-09 19:07 ` Prathamesh Kulkarni
1 sibling, 0 replies; 13+ messages in thread
From: Prathamesh Kulkarni @ 2019-09-09 19:07 UTC (permalink / raw)
To: James Greenhalgh; +Cc: gcc Patches, nd
On Thu, 22 Aug 2019 at 00:05, Prathamesh Kulkarni
<prathamesh.kulkarni@linaro.org> wrote:
>
> On Mon, 19 Aug 2019 at 22:14, James Greenhalgh <james.greenhalgh@arm.com> wrote:
> >
> > On Thu, Aug 15, 2019 at 02:11:25PM +0100, Prathamesh Kulkarni wrote:
> > > On Thu, 8 Aug 2019 at 11:22, Prathamesh Kulkarni
> > > <prathamesh.kulkarni@linaro.org> wrote:
> > > >
> > > > On Thu, 1 Aug 2019 at 15:34, Prathamesh Kulkarni
> > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > >
> > > > > On Thu, 25 Jul 2019 at 11:56, Prathamesh Kulkarni
> > > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > > >
> > > > > > On Wed, 17 Jul 2019 at 18:15, Prathamesh Kulkarni
> > > > > > <prathamesh.kulkarni@linaro.org> wrote:
> > > > > > >
> > > > > > > On Wed, 17 Jul 2019 at 13:45, Kyrill Tkachov
> > > > > > > <kyrylo.tkachov@foss.arm.com> 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)
> > > > > > > > > {
> > > > > > > > > return (__sync_bool_compare_and_swap (AL+1, 0x200000003ll,
> > > > > > > > > 0x1234567890ll));
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > Compiling with -O2 -march=armv8.2-a results in:
> > > > > > > > > pr90724.c: In function ‘check_ok’:
> > > > > > > > > pr90724.c:7:1: error: unrecognizable insn:
> > > > > > > > > 7 | }
> > > > > > > > > | ^
> > > > > > > > > (insn 11 10 12 2 (set (reg:CC 66 cc)
> > > > > > > > > (compare:CC (reg:DI 95)
> > > > > > > > > (const_int 8589934595 [0x200000003]))) "pr90724.c":6:11 -1
> > > > > > > > > (nil))
> > > > > > > > >
> > > > > > > > > IIUC, the issue is that 0x200000003 falls outside the range of
> > > > > > > > > allowable immediate in cmp ? If it's replaced by a small constant then
> > > > > > > > > it works.
> > > > > > > > >
> > > > > > > > > The ICE results with -march=armv8.2-a because, we enter if
> > > > > > > > > (TARGET_LSE) { ... } condition
> > > > > > > > > in aarch64_expand_compare_and_swap, while with -march=armv8.a it goes
> > > > > > > > > into else,
> > > > > > > > > which forces oldval into register if the predicate fails to match.
> > > > > > > > >
> > > > > > > > > The attached patch checks if y (oldval) satisfies aarch64_plus_operand
> > > > > > > > > predicate and if not, forces it to be in register, which resolves ICE.
> > > > > > > > > Does it look OK ?
> > > > > > > > >
> > > > > > > > > Bootstrap+testing in progress on aarch64-linux-gnu.
> > > > > > > > >
> > > > > > > > > PS: The issue has nothing to do with SVE, which I incorrectly
> > > > > > > > > mentioned in bug report.
> > > > > > > > >
> > > > > > > > This looks ok to me (but you'll need maintainer approval).
> > > > > > > >
> > > > > > > > Does this fail on the branches as well?
> > > > > > > Hi Kyrill,
> > > > > > > Thanks for the review. The test also fails on gcc-9-branch (but not on gcc-8).
> > > > > > Hi James,
> > > > > > Is the patch OK to commit ?
> > > > > > https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > > > ping * 3: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > > ping * 4: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> > > ping * 5: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00793.html
> >
> > Hi,
> >
> > Sorry, this missed my filters as it didn't mention AArch64 in the subject
> > line.
> >
> > Thais is good for trunk, thanks for waiting.
> Thanks, committed to trunk in r274805.
> Is this OK to backport to gcc-9-branch ?
ping ? Would it be OK to backport this patch to gcc-9-branch ?
Thanks,
Prathamesh
>
> Thanks,
> Prathamesh
> >
> > James
> >
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2019-09-09 19:07 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10 11:28 PR90724 - ICE with __sync_bool_compare_and_swap with -march=armv8.2-a Prathamesh Kulkarni
2019-07-17 7:19 ` Prathamesh Kulkarni
2019-07-17 8:18 ` Kyrill Tkachov
2019-07-17 13:40 ` Prathamesh Kulkarni
2019-07-25 7:50 ` Prathamesh Kulkarni
2019-08-01 10:04 ` Prathamesh Kulkarni
2019-08-08 6:31 ` Prathamesh Kulkarni
2019-08-15 13:30 ` Prathamesh Kulkarni
2019-08-19 18:34 ` James Greenhalgh
2019-08-21 20:48 ` Prathamesh Kulkarni
2019-08-22 3:18 ` JiangNing OS
2019-08-22 3:36 ` JiangNing OS
2019-09-09 19:07 ` Prathamesh Kulkarni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).