Commit 54414978 by Kirill Yukhin Committed by Kirill Yukhin

re PR target/65676 (ICE: in extract_insn, at recog.c:2343 (unrecognizable insn)…

re PR target/65676 (ICE: in extract_insn, at recog.c:2343 (unrecognizable insn) with -mavx512f -funsigned-char and __builtin_ia32_pmovsxwq512_mask())


        PR target/65676
gcc/
        * config/i386/i386.c (fixup_modeless_constant): New.
        (ix86_expand_args_builtin): Fixup modeless constant operand.
        PR target/65676
        * config/i386/i386.c (fixup_modeless_constant): New.
        (ix86_expand_args_builtin): Fixup modeless constant operand.
        (ix86_expand_round_builtin): Ditto.
        (ix86_expand_special_args_builtin): Ditto.
        (ix86_expand_builtin): Ditto.

gcc/testsuite/
        * gcc.target/i386/sse-25.c: New.
        (ix86_expand_round_builtin): Ditto.
        (ix86_expand_special_args_builtin): Ditto.
        (ix86_expand_builtin): Ditto.

testsuite/
        PR target/65676
        * gcc.target/i386/sse-25.c: New.

From-SVN: r221943
parent da0b9df9
2015-04-09 Kirill Yukhin <kirill.yukhin@intel.com>
PR target/65676
* config/i386/i386.c (fixup_modeless_constant): New.
(ix86_expand_args_builtin): Fixup modeless constant operand.
(ix86_expand_round_builtin): Ditto.
(ix86_expand_special_args_builtin): Ditto.
(ix86_expand_builtin): Ditto.
2015-04-09 Jakub Jelinek <jakub@redhat.com> 2015-04-09 Jakub Jelinek <jakub@redhat.com>
PR target/65693 PR target/65693
......
...@@ -35863,6 +35863,15 @@ safe_vector_operand (rtx x, machine_mode mode) ...@@ -35863,6 +35863,15 @@ safe_vector_operand (rtx x, machine_mode mode)
return x; return x;
} }
/* Fixup modeless constants to fit required mode. */
static rtx
fixup_modeless_constant (rtx x, machine_mode mode)
{
if (GET_MODE (x) == VOIDmode)
x = convert_to_mode (mode, x, 1);
return x;
}
/* Subroutine of ix86_expand_builtin to take care of binop insns. */ /* Subroutine of ix86_expand_builtin to take care of binop insns. */
static rtx static rtx
...@@ -37509,6 +37518,8 @@ ix86_expand_args_builtin (const struct builtin_description *d, ...@@ -37509,6 +37518,8 @@ ix86_expand_args_builtin (const struct builtin_description *d,
if (memory_operand (op, mode)) if (memory_operand (op, mode))
num_memory++; num_memory++;
op = fixup_modeless_constant (op, mode);
if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode)
{ {
if (optimize || !match || num_memory > 1) if (optimize || !match || num_memory > 1)
...@@ -37882,6 +37893,8 @@ ix86_expand_round_builtin (const struct builtin_description *d, ...@@ -37882,6 +37893,8 @@ ix86_expand_round_builtin (const struct builtin_description *d,
if (VECTOR_MODE_P (mode)) if (VECTOR_MODE_P (mode))
op = safe_vector_operand (op, mode); op = safe_vector_operand (op, mode);
op = fixup_modeless_constant (op, mode);
if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode)
{ {
if (optimize || !match) if (optimize || !match)
...@@ -38289,6 +38302,8 @@ ix86_expand_special_args_builtin (const struct builtin_description *d, ...@@ -38289,6 +38302,8 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
if (VECTOR_MODE_P (mode)) if (VECTOR_MODE_P (mode))
op = safe_vector_operand (op, mode); op = safe_vector_operand (op, mode);
op = fixup_modeless_constant (op, mode);
if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode)
op = copy_to_mode_reg (mode, op); op = copy_to_mode_reg (mode, op);
else else
...@@ -39852,6 +39867,9 @@ addcarryx: ...@@ -39852,6 +39867,9 @@ addcarryx:
op1 = copy_to_mode_reg (Pmode, op1); op1 = copy_to_mode_reg (Pmode, op1);
if (!insn_data[icode].operand[3].predicate (op2, mode2)) if (!insn_data[icode].operand[3].predicate (op2, mode2))
op2 = copy_to_mode_reg (mode2, op2); op2 = copy_to_mode_reg (mode2, op2);
op3 = fixup_modeless_constant (op3, mode3);
if (GET_MODE (op3) == mode3 || GET_MODE (op3) == VOIDmode) if (GET_MODE (op3) == mode3 || GET_MODE (op3) == VOIDmode)
{ {
if (!insn_data[icode].operand[4].predicate (op3, mode3)) if (!insn_data[icode].operand[4].predicate (op3, mode3))
...@@ -39995,6 +40013,8 @@ addcarryx: ...@@ -39995,6 +40013,8 @@ addcarryx:
if (!insn_data[icode].operand[0].predicate (op0, Pmode)) if (!insn_data[icode].operand[0].predicate (op0, Pmode))
op0 = copy_to_mode_reg (Pmode, op0); op0 = copy_to_mode_reg (Pmode, op0);
op1 = fixup_modeless_constant (op1, mode1);
if (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode) if (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode)
{ {
if (!insn_data[icode].operand[1].predicate (op1, mode1)) if (!insn_data[icode].operand[1].predicate (op1, mode1))
...@@ -40041,6 +40061,8 @@ addcarryx: ...@@ -40041,6 +40061,8 @@ addcarryx:
mode3 = insn_data[icode].operand[3].mode; mode3 = insn_data[icode].operand[3].mode;
mode4 = insn_data[icode].operand[4].mode; mode4 = insn_data[icode].operand[4].mode;
op0 = fixup_modeless_constant (op0, mode0);
if (GET_MODE (op0) == mode0 if (GET_MODE (op0) == mode0
|| (GET_MODE (op0) == VOIDmode && op0 != constm1_rtx)) || (GET_MODE (op0) == VOIDmode && op0 != constm1_rtx))
{ {
2015-04-09 Kirill Yukhin <kirill.yukhin@intel.com>
PR target/65676
* gcc.target/i386/sse-25.c: New.
2015-04-09 Jakub Jelinek <jakub@redhat.com> 2015-04-09 Jakub Jelinek <jakub@redhat.com>
PR target/65693 PR target/65693
......
/* PR target/65676 */
/* { dg-do compile } */
/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -funsigned-char" } */
/* { dg-add-options bind_pic_locally } */
#include "sse-23.c"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment