diff mbox

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

Message ID 5649D86C.4010409@arm.com
State New
Headers show

Commit Message

Kyrylo Tkachov Nov. 16, 2015, 1:21 p.m. UTC
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.

Comments

James Greenhalgh Nov. 23, 2015, 2:51 p.m. UTC | #1
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
diff mbox

Patch

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;
+}