From 93505ec51e376cf08e37732b8fba5933d058490b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 3 Mar 2017 13:24:53 +0100 Subject: [PATCH] re PR target/79807 (ICE in extract_insn, at recog.c:2311 (error: unrecognizable insn)) PR target/79807 * config/i386/i386.c (ix86_expand_multi_arg_builtin): If target is a memory operand, increase num_memory. (ix86_expand_args_builtin): Likewise. * gcc.target/i386/pr79807.c: New test. From-SVN: r245871 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.c | 4 ++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr79807.c | 12 ++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr79807.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1fa51ddf405..f12ffca4ea5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-03-03 Jakub Jelinek + + PR target/79807 + * config/i386/i386.c (ix86_expand_multi_arg_builtin): If target + is a memory operand, increase num_memory. + (ix86_expand_args_builtin): Likewise. + 2017-03-03 Jan Hubicka PR lto/79760 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 754c016f139..1b982077cae 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -34249,6 +34249,8 @@ ix86_expand_multi_arg_builtin (enum insn_code icode, tree exp, rtx target, || GET_MODE (target) != tmode || !insn_data[icode].operand[0].predicate (target, tmode)) target = gen_reg_rtx (tmode); + else if (memory_operand (target, tmode)) + num_memory++; gcc_assert (nargs <= 4); @@ -35534,6 +35536,8 @@ ix86_expand_args_builtin (const struct builtin_description *d, || GET_MODE (target) != tmode || !insn_p->operand[0].predicate (target, tmode)) target = gen_reg_rtx (tmode); + else if (memory_operand (target, tmode)) + num_memory++; real_target = target; } else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a1586282379..9bece40e0f3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-03 Jakub Jelinek + + PR target/79807 + * gcc.target/i386/pr79807.c: New test. + 2017-03-03 Martin Liska PR tree-optimization/79803 diff --git a/gcc/testsuite/gcc.target/i386/pr79807.c b/gcc/testsuite/gcc.target/i386/pr79807.c new file mode 100644 index 00000000000..e491a4da8ef --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr79807.c @@ -0,0 +1,12 @@ +/* PR target/79807 */ +/* { dg-do compile } */ +/* { dg-options "-O0 -mavx -ffloat-store" } */ + +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef double __v4df __attribute__ ((__vector_size__ (32))); + +__v2df +foo (__v4df x) +{ + return __builtin_ia32_pd_pd256 (x); +} -- 2.30.2