From: Uros Bizjak Date: Sun, 20 Nov 2011 22:26:14 +0000 (+0100) Subject: re PR target/51235 (ICE: in extract_insn, at recog.c:2137 (unrecognizable insn) with... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fd9ee5972eb7ceb1e8da07b854431f1c7375ef53;p=gcc.git re PR target/51235 (ICE: in extract_insn, at recog.c:2137 (unrecognizable insn) with -O -ftree-vectorize -mavx2 -mxop) PR target/51235 * config/i386/i386.c (ix86_expand_vcond): Generate TARGET_XOP patterns for supported mode only. PR target/51236 * config/i386/i386.c (ix86_expand_builtin) : Use CODE_FOR_avx2_gathersiv4di. testsuite/ChangeLog: PR target/51235 * gcc.target/i386/pr51235.c: New test. PR target/51236 * gcc.target/i386/pr51236.c: New test. From-SVN: r181537 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d2ed66a97a9..9bef97dff15 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2011-11-20 Uros Bizjak + + PR target/51235 + * config/i386/i386.c (ix86_expand_vcond): Generate TARGET_XOP + patterns for supported mode only. + + PR target/51236 + * config/i386/i386.c (ix86_expand_builtin) + : Use CODE_FOR_avx2_gathersiv4di. + 2011-11-20 Uros Bizjak * config/i386/i386.md (UNSPEC_MOVNTI): Remove. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d92f8e2c631..34368203cd9 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -19619,8 +19619,12 @@ ix86_expand_int_vcond (rtx operands[]) cop0 = operands[4]; cop1 = operands[5]; - /* XOP supports all of the comparisons on all vector int types. */ - if (!TARGET_XOP) + /* XOP supports all of the comparisons on all 128-bit vector int types. */ + if (TARGET_XOP + && (mode == V16QImode || mode == V8HImode + || mode == V4SImode || mode == V2DImode)) + ; + else { /* Canonicalize the comparison to EQ, GT, GTU. */ switch (code) @@ -30013,7 +30017,7 @@ rdrand_step: icode = CODE_FOR_avx2_gatherdiv8sf; goto gather_gen; case IX86_BUILTIN_GATHERALTSIV4DI: - icode = CODE_FOR_avx2_gathersiv4df; + icode = CODE_FOR_avx2_gathersiv4di; goto gather_gen; case IX86_BUILTIN_GATHERALTDIV8SI: icode = CODE_FOR_avx2_gatherdiv8si; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6c85640c261..2a9c6d101db 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2011-11-20 Uros Bizjak + + PR target/51235 + * gcc.target/i386/pr51235.c: New test. + + PR target/51236 + * gcc.target/i386/pr51236.c: New test. + 2011-11-20 Eric Botcazou * gnat.dg/discr32.adb: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr51235.c b/gcc/testsuite/gcc.target/i386/pr51235.c new file mode 100644 index 00000000000..c99d5c0e733 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr51235.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O -ftree-vectorize -mxop -mavx2" } */ + +void *foo (int count, void **list) +{ + void *minaddr = list[0]; + int i; + + for (i = 1; i < count; i++) + { + void *addr = list[i]; + if (addr < minaddr) + minaddr = addr; + } + + return minaddr; +} diff --git a/gcc/testsuite/gcc.target/i386/pr51236.c b/gcc/testsuite/gcc.target/i386/pr51236.c new file mode 100644 index 00000000000..63bfaeeb0eb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr51236.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O -ftree-vectorize -mavx2" } */ + +long foo (long *p, int i) +{ + long x = 0; + + while (--i) + x ^= p[i]; + + return x; +}