From 198c27e98311d1d3561f154e75a9df23bff8bacf Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 28 Mar 2019 20:15:58 +0100 Subject: [PATCH] re PR target/89848 (ICE: in convert_op, at config/i386/i386.c:2099 with -O2 -msse2 -mtune=pentium3m) PR target/89848 * config/i386/i386.c (dimode_scalar_chain::make_vector_copies): Also process XEXP (src, 0) of a shift insn. testsuite/ChangeLog: PR target/89848 * gcc.target/i386/pr89848.c: New test. From-SVN: r270003 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 5 ++++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr89848.c | 11 +++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr89848.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 741639daa12..2ce421515af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-03-28 Uroš Bizjak + + PR target/89848 + * config/i386/i386.c (dimode_scalar_chain::make_vector_copies): + Also process XEXP (src, 0) of a shift insn. + 2019-03-28 David Malcolm PR middle-end/89725 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c695fcdc32f..6926085fdd2 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1901,7 +1901,10 @@ dimode_scalar_chain::make_vector_copies (unsigned regno) || GET_CODE (src) == LSHIFTRT) && !CONST_INT_P (XEXP (src, 1)) && reg_or_subregno (XEXP (src, 1)) == regno) - XEXP (src, 1) = vreg; + { + XEXP (src, 0) = replace_with_subreg (XEXP (src, 0), reg, reg); + XEXP (src, 1) = vreg; + } } else replace_with_subreg_in_insn (insn, reg, vreg); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0210cd72935..cf9ed5cda8f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-28 Uroš Bizjak + + PR target/89848 + * gcc.target/i386/pr89848.c: New test. + 2019-03-28 Marek Polacek PR c++/89836 - bool constant expression and explicit conversions. diff --git a/gcc/testsuite/gcc.target/i386/pr89848.c b/gcc/testsuite/gcc.target/i386/pr89848.c new file mode 100644 index 00000000000..eb67d0dd1e8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr89848.c @@ -0,0 +1,11 @@ +/* PR target/89848 */ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-O2 -msse2 -mtune=pentium3m" } */ + +long long +foo (long long x) +{ + x >>= 3; + x <<= x; + return x; +} -- 2.30.2