From a2273e72f3bbb2ddbeb720e60f3f33d68530f5df Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Wed, 25 Feb 2015 15:05:48 +0000 Subject: [PATCH] re PR target/65167 (ICE: in assign_by_spills, at lra-assigns.c:1383 (unable to find a register to spill) with -O -fschedule-insns -fcheck-pointer-bounds -mmpx) gcc/ PR target/65167 * gcc/config/i386/i386.c (ix86_function_arg_regno_p): Support bounds registers. (avoid_func_arg_motion): Add dependencies for BNDSTX insns. gcc/testsuite/ PR target/65167 * gcc.target/i386/pr65167.c: New. From-SVN: r220970 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.c | 13 +++++++++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr65167.c | 11 +++++++++++ 4 files changed, 36 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr65167.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1e2b6097169..6e9faf9f0d8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-02-25 Ilya Enkovich + + PR target/65167 + * gcc/config/i386/i386.c (ix86_function_arg_regno_p): Support + bounds registers. + (avoid_func_arg_motion): Add dependencies for BNDSTX insns. + 2015-02-25 Alan Lawrence PR target/64997 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index bc4fb4be399..a1cb5dade38 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6120,6 +6120,9 @@ ix86_function_arg_regno_p (int regno) int i; const int *parm_regs; + if (TARGET_MPX && BND_REGNO_P (regno)) + return true; + if (!TARGET_64BIT) { if (TARGET_MACHO) @@ -26898,6 +26901,16 @@ avoid_func_arg_motion (rtx_insn *first_arg, rtx_insn *insn) rtx set; rtx tmp; + /* Add anti dependencies for bounds stores. */ + if (INSN_P (insn) + && GET_CODE (PATTERN (insn)) == PARALLEL + && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == UNSPEC + && XINT (XVECEXP (PATTERN (insn), 0, 0), 1) == UNSPEC_BNDSTX) + { + add_dependence (first_arg, insn, REG_DEP_ANTI); + return; + } + set = single_set (insn); if (!set) return; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 49bf525cdaf..199b967c07c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-02-25 Ilya Enkovich + + PR target/65167 + * gcc.target/i386/pr65167.c: New. + 2015-02-25 Kai Tietz PR tree-optimization/61917 diff --git a/gcc/testsuite/gcc.target/i386/pr65167.c b/gcc/testsuite/gcc.target/i386/pr65167.c new file mode 100644 index 00000000000..35f3d6bc884 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr65167.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target mpx } */ +/* { dg-options "-O -fschedule-insns -fcheck-pointer-bounds -mmpx" } */ + +void bar(int *a, int *b, int *c, int *d, int *e, int *f); + +int foo (int *a, int *b, int *c, int *d, int *e, int *f) +{ + bar (a, b, c, d, e, f); + return *f; +} -- 2.30.2