public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][AArch64] PR target/68363 Check that argument is real INSN in aarch64_madd_needs_nop
@ 2015-11-16 13:21 Kyrill Tkachov
  2015-11-23 14:55 ` James Greenhalgh
  0 siblings, 1 reply; 2+ messages in thread
From: Kyrill Tkachov @ 2015-11-16 13:21 UTC (permalink / raw)
  To: GCC Patches; +Cc: Marcus Shawcroft, Richard Earnshaw, James Greenhalgh

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

Hi all,

This RTL checking ICE occurs when processing an rtx_insn* in aarch64_madd_needs_nop that apparently
holds JUMP_TABLE_DATA. This shouldn't be passed to recog. So instead reject it with the INSN_P check.
Such rtx_insns are not relevant to the code in aarch64_madd_needs_nop anyway.

Bootstrapped and tested on trunk, GCC 5 and 4.9 configured with --enable-fix-cortex-a53-835769
--enable-checking=yes,rtl.

Ok for all branches? (the testcase passes on 4.8, presumably before the conversion to rtx_insn)

Thanks,
Kyrill

2015-11-16  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     PR target/68363
     * config/aarch64/aarch64.c (aarch64_madd_needs_nop): Reject arguments
     that are not INSN_P.

2015-11-16  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     PR target/68363
     * gcc.target/aarch64/pr68363_1.c: New test.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: aarch64-madd-insn.patch --]
[-- Type: text/x-patch; name=aarch64-madd-insn.patch, Size: 1193 bytes --]

commit a2fa69050c8a0dc824f5892f01385acdf35c54cc
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Mon Nov 16 09:18:14 2015 +0000

    [AArch64] PR target/68363 Check that argument is real INSN in aarch64_madd_needs_nop

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 19dfc51..0b02f1e 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -10105,7 +10105,7 @@ aarch64_madd_needs_nop (rtx_insn* insn)
   if (!TARGET_FIX_ERR_A53_835769)
     return false;
 
-  if (recog_memoized (insn) < 0)
+  if (!INSN_P (insn) || recog_memoized (insn) < 0)
     return false;
 
   attr_type = get_attr_type (insn);
diff --git a/gcc/testsuite/gcc.target/aarch64/pr68363_1.c b/gcc/testsuite/gcc.target/aarch64/pr68363_1.c
new file mode 100644
index 0000000..bb294b5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr68363_1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-mfix-cortex-a53-835769" } */
+
+int
+foo (int i)
+{
+  switch (i)
+    {
+    case 0:
+    case 2:
+    case 5:
+      return 0;
+    case 7:
+    case 11:
+    case 13:
+      return 1;
+    }
+  return -1;
+}

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

* Re: [PATCH][AArch64] PR target/68363 Check that argument is real INSN in aarch64_madd_needs_nop
  2015-11-16 13:21 [PATCH][AArch64] PR target/68363 Check that argument is real INSN in aarch64_madd_needs_nop Kyrill Tkachov
@ 2015-11-23 14:55 ` James Greenhalgh
  0 siblings, 0 replies; 2+ messages in thread
From: James Greenhalgh @ 2015-11-23 14:55 UTC (permalink / raw)
  To: Kyrill Tkachov; +Cc: GCC Patches, Marcus Shawcroft, Richard Earnshaw

On Mon, Nov 16, 2015 at 01:21:48PM +0000, Kyrill Tkachov wrote:
> Hi all,
> 
> This RTL checking ICE occurs when processing an rtx_insn* in
> aarch64_madd_needs_nop that apparently holds JUMP_TABLE_DATA. This shouldn't
> be passed to recog. So instead reject it with the INSN_P check.  Such
> rtx_insns are not relevant to the code in aarch64_madd_needs_nop anyway.
> 
> Bootstrapped and tested on trunk, GCC 5 and 4.9 configured with
> --enable-fix-cortex-a53-835769 --enable-checking=yes,rtl.
> 
> Ok for all branches? (the testcase passes on 4.8, presumably before the
> conversion to rtx_insn)
> 
> 2015-11-16  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
>     PR target/68363
>     * config/aarch64/aarch64.c (aarch64_madd_needs_nop): Reject arguments
>     that are not INSN_P.
> 
> 2015-11-16  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
>     PR target/68363
>     * gcc.target/aarch64/pr68363_1.c: New test.


OK.

Thanks,
James

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

end of thread, other threads:[~2015-11-23 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16 13:21 [PATCH][AArch64] PR target/68363 Check that argument is real INSN in aarch64_madd_needs_nop Kyrill Tkachov
2015-11-23 14:55 ` James Greenhalgh

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