From 837e188b6b51667acb83cb4a9f47c1f1b8e0004d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 22 Jun 2018 23:10:59 +0200 Subject: [PATCH] backport: re PR target/85430 (ICE: SIGSEGV in memory_operand at recog.c:1358/9 with -O2 -fno-tree-ccp -fno-tree-fre) Backported from mainline 2018-04-17 Jakub Jelinek PR target/85430 * config/i386/i386.md (*ashlqi3_1_slp): Use alu1 type instead of alu. * gcc.dg/pr85430.c: New test. From-SVN: r261954 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386.md | 6 +++--- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr85430.c | 12 ++++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr85430.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2850fa03bfe8..52232caf7a14 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,11 @@ 2018-06-22 Jakub Jelinek Backported from mainline + 2018-04-17 Jakub Jelinek + + PR target/85430 + * config/i386/i386.md (*ashlqi3_1_slp): Use alu1 type instead of alu. + 2018-04-10 Jakub Jelinek PR rtl-optimization/85300 diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 5d0cd5311b7c..8469cf02510c 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -9973,7 +9973,7 @@ { switch (get_attr_type (insn)) { - case TYPE_ALU: + case TYPE_ALU1: gcc_assert (operands[1] == const1_rtx); return "add{b}\t%0, %0"; @@ -9989,12 +9989,12 @@ (cond [(and (and (match_test "TARGET_DOUBLE_WITH_ADD") (match_operand 0 "register_operand")) (match_operand 1 "const1_operand")) - (const_string "alu") + (const_string "alu1") ] (const_string "ishift1"))) (set (attr "length_immediate") (if_then_else - (ior (eq_attr "type" "alu") + (ior (eq_attr "type" "alu1") (and (eq_attr "type" "ishift1") (and (match_operand 1 "const1_operand") (ior (match_test "TARGET_SHIFT1") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 27f70405941e..554465f0d78d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,11 @@ 2018-06-22 Jakub Jelinek Backported from mainline + 2018-04-17 Jakub Jelinek + + PR target/85430 + * gcc.dg/pr85430.c: New test. + 2018-04-10 Jakub Jelinek PR rtl-optimization/85300 diff --git a/gcc/testsuite/gcc.dg/pr85430.c b/gcc/testsuite/gcc.dg/pr85430.c new file mode 100644 index 000000000000..7b58a3cd5674 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr85430.c @@ -0,0 +1,12 @@ +/* PR target/85430 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-ccp -fno-tree-fre" } */ + +typedef char V __attribute__((vector_size (4))); + +V +foo (V v) +{ + v[(V){}[0]] <<= 1; + return v; +} -- 2.47.2