From: Jakub Jelinek Date: Sun, 31 Dec 2017 23:50:32 +0000 (+0100) Subject: re PR middle-end/83623 (ICE: in convert_move, at expr.c:248 with -march=knl and 16bit... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d235d09b7c86a2955bebdcb1991cd21758bcc21b;p=gcc.git re PR middle-end/83623 (ICE: in convert_move, at expr.c:248 with -march=knl and 16bit vector bswap/rotate) PR middle-end/83623 * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT, check for bswap in mode rather than HImode and use that in expand_unop too. * gcc.dg/pr83623.c: New test. From-SVN: r256051 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c2913d298e7..548bb17c10c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-01-01 Jakub Jelinek + + PR middle-end/83623 + * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT, + check for bswap in mode rather than HImode and use that in expand_unop + too. + 2017-12-31 Jakub Jelinek PR target/83536 diff --git a/gcc/expmed.c b/gcc/expmed.c index 6b22946f69a..55bb353cd75 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -2490,9 +2490,8 @@ expand_shift_1 (enum tree_code code, machine_mode mode, rtx shifted, && CONST_INT_P (op1) && INTVAL (op1) == BITS_PER_UNIT && GET_MODE_SIZE (scalar_mode) == 2 - && optab_handler (bswap_optab, HImode) != CODE_FOR_nothing) - return expand_unop (HImode, bswap_optab, shifted, NULL_RTX, - unsignedp); + && optab_handler (bswap_optab, mode) != CODE_FOR_nothing) + return expand_unop (mode, bswap_optab, shifted, NULL_RTX, unsignedp); if (op1 == const0_rtx) return shifted; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 43f137e089b..f89ae2e5496 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-01-01 Jakub Jelinek + PR middle-end/83623 + * gcc.dg/pr83623.c: New test. + * gcc.target/i386/i386.exp (check_effective_target_avx512vpopcntdqvl): New proc. * gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Use diff --git a/gcc/testsuite/gcc.dg/pr83623.c b/gcc/testsuite/gcc.dg/pr83623.c new file mode 100644 index 00000000000..5d62c04f542 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr83623.c @@ -0,0 +1,12 @@ +/* PR middle-end/83623 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-additional-options "-mmovbe" { target i?86-*-* x86_64-*-* } } */ + +unsigned short __attribute__ ((__vector_size__ (16))) x; + +void +foo (void) +{ + x = x << 8 | x >> 8; +}