public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH PR82096][gcc-7] Backport: Fix ICE in int_mode_for_mode, at stor-layout.c:403 with arm-linux-gnueabi
@ 2018-01-22 15:22 Sudakshina Das
  2018-01-22 15:52 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Sudakshina Das @ 2018-01-22 15:22 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd, Kyrill Tkachov, Ramana Radhakrishnan, Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

Hi

This is a patch to backport r256526 and r256941 (Fix case fix) of trunk 
to fix emit_store_flag_force () function to fix the ICE. The original 
discussion is at 
https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00219.html and 
https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01058.html

Is this ok for gcc-7-branch?
Testing : Ran regression testing with bootstrapped arm-none-linux-gnueabihf.

Thanks
Sudi

ChangeLog entries:

*** gcc/ChangeLog ***

2018-01-22  Sudakshina Das  <sudi.das@arm.com>

	Backport from mainline:
	2018-01-10  Sudakshina Das  <sudi.das@arm.com>

	PR target/82096
	* expmed.c (emit_store_flag_force): Swap if const op0
	and change VOIDmode to mode of op0.

*** gcc/testsuite/ChangeLog ***

2018-01-22  Sudakshina Das  <sudi.das@arm.com>

	Backport from mainline:
	2018-01-10  Sudakshina Das  <sudi.das@arm.com>

	PR target/82096
	* gcc.c-torture/compile/pr82096.c: New test.

[-- Attachment #2: pr82096-7.diff --]
[-- Type: text/x-patch, Size: 1265 bytes --]

diff --git a/gcc/expmed.c b/gcc/expmed.c
index e9f634a..30001ac 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -5886,6 +5886,18 @@ emit_store_flag_force (rtx target, enum rtx_code code, rtx op0, rtx op1,
   if (tem != 0)
     return tem;
 
+  /* If one operand is constant, make it the second one.  Only do this
+     if the other operand is not constant as well.  */
+
+  if (swap_commutative_operands_p (op0, op1))
+    {
+      std::swap (op0, op1);
+      code = swap_condition (code);
+    }
+
+  if (mode == VOIDmode)
+    mode = GET_MODE (op0);
+
   if (!target)
     target = gen_reg_rtx (word_mode);
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr82096.c b/gcc/testsuite/gcc.c-torture/compile/pr82096.c
new file mode 100644
index 0000000..d144b70
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr82096.c
@@ -0,0 +1,11 @@
+/* { dg-require-effective-target arm_arch_v5t_ok { target arm*-*-* } } */
+/* { dg-skip-if "Do not combine float-abi values" { arm*-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */
+/* { dg-additional-options "-march=armv5t -mthumb -mfloat-abi=soft" { target arm*-*-* } } */
+
+static long long AL[24];
+
+int
+check_ok (void)
+{
+  return (__sync_bool_compare_and_swap (AL+1, 0x200000003ll, 0x1234567890ll));
+}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH PR82096][gcc-7] Backport: Fix ICE in int_mode_for_mode, at stor-layout.c:403 with arm-linux-gnueabi
  2018-01-22 15:22 [PATCH PR82096][gcc-7] Backport: Fix ICE in int_mode_for_mode, at stor-layout.c:403 with arm-linux-gnueabi Sudakshina Das
@ 2018-01-22 15:52 ` Richard Biener
  2018-02-16 15:40   ` Sudakshina Das
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2018-01-22 15:52 UTC (permalink / raw)
  To: Sudakshina Das
  Cc: gcc-patches, nd, Kyrill Tkachov, Ramana Radhakrishnan, Richard Earnshaw

On Mon, Jan 22, 2018 at 4:10 PM, Sudakshina Das <sudi.das@arm.com> wrote:
> Hi
>
> This is a patch to backport r256526 and r256941 (Fix case fix) of trunk to
> fix emit_store_flag_force () function to fix the ICE. The original
> discussion is at https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00219.html
> and https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01058.html
>
> Is this ok for gcc-7-branch?
> Testing : Ran regression testing with bootstrapped arm-none-linux-gnueabihf.

The branch is currently frozen so please wait until after the GCC 7.3 release.

Thanks,
Richard.

> Thanks
> Sudi
>
> ChangeLog entries:
>
> *** gcc/ChangeLog ***
>
> 2018-01-22  Sudakshina Das  <sudi.das@arm.com>
>
>         Backport from mainline:
>         2018-01-10  Sudakshina Das  <sudi.das@arm.com>
>
>         PR target/82096
>         * expmed.c (emit_store_flag_force): Swap if const op0
>         and change VOIDmode to mode of op0.
>
> *** gcc/testsuite/ChangeLog ***
>
> 2018-01-22  Sudakshina Das  <sudi.das@arm.com>
>
>         Backport from mainline:
>         2018-01-10  Sudakshina Das  <sudi.das@arm.com>
>
>         PR target/82096
>         * gcc.c-torture/compile/pr82096.c: New test.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH PR82096][gcc-7] Backport: Fix ICE in int_mode_for_mode, at stor-layout.c:403 with arm-linux-gnueabi
  2018-01-22 15:52 ` Richard Biener
@ 2018-02-16 15:40   ` Sudakshina Das
  2018-02-21 12:55     ` [PATCH PR82096][gcc-7, gcc-6] " Sudakshina Das
  0 siblings, 1 reply; 4+ messages in thread
From: Sudakshina Das @ 2018-02-16 15:40 UTC (permalink / raw)
  To: Richard Biener
  Cc: gcc-patches, nd, Kyrill Tkachov, Ramana Radhakrishnan, Richard Earnshaw

On 22/01/18 15:23, Richard Biener wrote:
> On Mon, Jan 22, 2018 at 4:10 PM, Sudakshina Das <sudi.das@arm.com> wrote:
>> Hi
>>
>> This is a patch to backport r256526 and r256941 (Fix case fix) of trunk to
>> fix emit_store_flag_force () function to fix the ICE. The original
>> discussion is at https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00219.html
>> and https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01058.html
>>
>> Is this ok for gcc-7-branch?
>> Testing : Ran regression testing with bootstrapped arm-none-linux-gnueabihf.
> 
> The branch is currently frozen so please wait until after the GCC 7.3 release.

Committed as r257741

Thanks
Sudi

> 
> Thanks,
> Richard.
> 
>> Thanks
>> Sudi
>>
>> ChangeLog entries:
>>
>> *** gcc/ChangeLog ***
>>
>> 2018-01-22  Sudakshina Das  <sudi.das@arm.com>
>>
>>          Backport from mainline:
>>          2018-01-10  Sudakshina Das  <sudi.das@arm.com>
>>
>>          PR target/82096
>>          * expmed.c (emit_store_flag_force): Swap if const op0
>>          and change VOIDmode to mode of op0.
>>
>> *** gcc/testsuite/ChangeLog ***
>>
>> 2018-01-22  Sudakshina Das  <sudi.das@arm.com>
>>
>>          Backport from mainline:
>>          2018-01-10  Sudakshina Das  <sudi.das@arm.com>
>>
>>          PR target/82096
>>          * gcc.c-torture/compile/pr82096.c: New test.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH PR82096][gcc-7, gcc-6] Backport: Fix ICE in int_mode_for_mode, at stor-layout.c:403 with arm-linux-gnueabi
  2018-02-16 15:40   ` Sudakshina Das
@ 2018-02-21 12:55     ` Sudakshina Das
  0 siblings, 0 replies; 4+ messages in thread
From: Sudakshina Das @ 2018-02-21 12:55 UTC (permalink / raw)
  To: Richard Biener
  Cc: gcc-patches, nd, Kyrill Tkachov, Ramana Radhakrishnan, Richard Earnshaw

On 16/02/18 15:40, Sudakshina Das wrote:
> On 22/01/18 15:23, Richard Biener wrote:
>> On Mon, Jan 22, 2018 at 4:10 PM, Sudakshina Das <sudi.das@arm.com> wrote:
>>> Hi
>>>
>>> This is a patch to backport r256526 and r256941 (Fix case fix) of 
>>> trunk to
>>> fix emit_store_flag_force () function to fix the ICE. The original
>>> discussion is at 
>>> https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00219.html
>>> and https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01058.html
>>>
>>> Is this ok for gcc-7-branch?
>>> Testing : Ran regression testing with bootstrapped 
>>> arm-none-linux-gnueabihf.
>>
>> The branch is currently frozen so please wait until after the GCC 7.3 
>> release.
> 
> Committed as r257741

Backported to gcc-6 as r257871

Thanks
Sudi

> 
> Thanks
> Sudi
> 
>>
>> Thanks,
>> Richard.
>>
>>> Thanks
>>> Sudi
>>>
>>> ChangeLog entries:
>>>
>>> *** gcc/ChangeLog ***
>>>
>>> 2018-01-22  Sudakshina Das  <sudi.das@arm.com>
>>>
>>>          Backport from mainline:
>>>          2018-01-10  Sudakshina Das  <sudi.das@arm.com>
>>>
>>>          PR target/82096
>>>          * expmed.c (emit_store_flag_force): Swap if const op0
>>>          and change VOIDmode to mode of op0.
>>>
>>> *** gcc/testsuite/ChangeLog ***
>>>
>>> 2018-01-22  Sudakshina Das  <sudi.das@arm.com>
>>>
>>>          Backport from mainline:
>>>          2018-01-10  Sudakshina Das  <sudi.das@arm.com>
>>>
>>>          PR target/82096
>>>          * gcc.c-torture/compile/pr82096.c: New test.
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-21 12:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-22 15:22 [PATCH PR82096][gcc-7] Backport: Fix ICE in int_mode_for_mode, at stor-layout.c:403 with arm-linux-gnueabi Sudakshina Das
2018-01-22 15:52 ` Richard Biener
2018-02-16 15:40   ` Sudakshina Das
2018-02-21 12:55     ` [PATCH PR82096][gcc-7, gcc-6] " Sudakshina Das

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).