From 8000827901d090f62414ff75203e03b00acd4ca5 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 14 Dec 2016 22:39:51 +0100 Subject: [PATCH] re PR target/78791 (ACATS cxf2001 failure) PR target/78791 * config/i386/i386.h (enum ix86_stack_slot): Add SLOT_STV_TEMP. * config/i386/i386.c (dimode_scalar_chain::make_vector_copies, dimode_scalar_chain::convert_reg): Use SLOT_STV_TEMP instead of SLOT_TEMP. * gcc.c-torture/execute/pr78791.c: New test. * gcc.target/i386/pr78791.c: New test. From-SVN: r243671 --- gcc/ChangeLog | 8 ++++++++ gcc/config/i386/i386.c | 4 ++-- gcc/config/i386/i386.h | 1 + gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.c-torture/execute/pr78791.c | 19 +++++++++++++++++++ gcc/testsuite/gcc.target/i386/pr78791.c | 5 +++++ 6 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr78791.c create mode 100644 gcc/testsuite/gcc.target/i386/pr78791.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1fbc8727a52..3cc2e5a6550 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2016-12-14 Jakub Jelinek + + PR target/78791 + * config/i386/i386.h (enum ix86_stack_slot): Add SLOT_STV_TEMP. + * config/i386/i386.c (dimode_scalar_chain::make_vector_copies, + dimode_scalar_chain::convert_reg): Use SLOT_STV_TEMP instead of + SLOT_TEMP. + 2016-12-14 Uros Bizjak PR target/59874 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3d9d485ad19..792e8ec232d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3560,7 +3560,7 @@ dimode_scalar_chain::make_vector_copies (unsigned regno) } else { - rtx tmp = assign_386_stack_local (DImode, SLOT_TEMP); + rtx tmp = assign_386_stack_local (DImode, SLOT_STV_TEMP); emit_move_insn (adjust_address (tmp, SImode, 0), gen_rtx_SUBREG (SImode, reg, 0)); emit_move_insn (adjust_address (tmp, SImode, 4), @@ -3637,7 +3637,7 @@ dimode_scalar_chain::convert_reg (unsigned regno) } else { - rtx tmp = assign_386_stack_local (DImode, SLOT_TEMP); + rtx tmp = assign_386_stack_local (DImode, SLOT_STV_TEMP); emit_move_insn (tmp, reg); emit_move_insn (gen_rtx_SUBREG (SImode, scopy, 0), adjust_address (tmp, SImode, 0)); diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 4d96a4525fb..5f5368da96d 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2400,6 +2400,7 @@ enum ix86_stack_slot SLOT_CW_FLOOR, SLOT_CW_CEIL, SLOT_CW_MASK_PM, + SLOT_STV_TEMP, MAX_386_STACK_LOCALS }; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5026f07b5dc..946ad97188e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-12-14 Jakub Jelinek + + PR target/78791 + * gcc.c-torture/execute/pr78791.c: New test. + * gcc.target/i386/pr78791.c: New test. + 2016-12-14 Marek Polacek PR c++/72775 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr78791.c b/gcc/testsuite/gcc.c-torture/execute/pr78791.c new file mode 100644 index 00000000000..987f2f16577 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr78791.c @@ -0,0 +1,19 @@ +/* PR target/78791 */ + +__attribute__((used, noinline, noclone)) unsigned long long +foo (unsigned long long x, unsigned long long y, unsigned long long z) +{ + unsigned long long a = x / y; + unsigned long long b = x % y; + a |= z; + b ^= z; + return a + b; +} + +int +main () +{ + if (foo (64, 7, 0) != 10 || foo (28, 3, 2) != 14) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr78791.c b/gcc/testsuite/gcc.target/i386/pr78791.c new file mode 100644 index 00000000000..297e03f7912 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr78791.c @@ -0,0 +1,5 @@ +/* PR target/78791 */ +/* { dg-do run { target sse2_runtime } } */ +/* { dg-options "-O2 -msse2" } */ + +#include "../../gcc.c-torture/execute/pr78791.c" -- 2.30.2