From 8eb9e049afc30be66324513ac21f10fb4859b6a0 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 6 Sep 2016 22:30:57 +0200 Subject: [PATCH] re PR target/69255 (ICE on x86_64-linux-gnu in "emit_move_insn") PR target/69255 * config/i386/i386.c (ix86_expand_builtin): For builtin with unsupported or unknown ISA, use expand_call. * gcc.target/i386/pr69255-1.c: New test. * gcc.target/i386/pr69255-2.c: New test. * gcc.target/i386/pr69255-3.c: New test. From-SVN: r240014 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 2 +- gcc/testsuite/ChangeLog | 9 ++++++++- gcc/testsuite/gcc.target/i386/pr69255-1.c | 17 +++++++++++++++++ gcc/testsuite/gcc.target/i386/pr69255-2.c | 17 +++++++++++++++++ gcc/testsuite/gcc.target/i386/pr69255-3.c | 17 +++++++++++++++++ 6 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr69255-1.c create mode 100644 gcc/testsuite/gcc.target/i386/pr69255-2.c create mode 100644 gcc/testsuite/gcc.target/i386/pr69255-3.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e23891e5155..7fb021201f6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-09-06 Jakub Jelinek + + PR target/69255 + * config/i386/i386.c (ix86_expand_builtin): For builtin with + unsupported or unknown ISA, use expand_call. + 2016-09-06 Martin Liska PR gcov-profile/77378 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index dc92f9be53b..016082941da 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -36107,7 +36107,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, error ("%qE needs isa option %s", fndecl, opts); free (opts); } - return const0_rtx; + return expand_call (exp, target, ignore); } switch (fcode) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4e24658c993..607742084a8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,11 @@ -2016-09-06 Martin Sebor +2016-09-06 Jakub Jelinek + + PR target/69255 + * gcc.target/i386/pr69255-1.c: New test. + * gcc.target/i386/pr69255-2.c: New test. + * gcc.target/i386/pr69255-3.c: New test. + +2016-09-06 Martin Sebor PR c/77336 * gcc.dg/format/miss-7.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr69255-1.c b/gcc/testsuite/gcc.target/i386/pr69255-1.c new file mode 100644 index 00000000000..7a666d34298 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr69255-1.c @@ -0,0 +1,17 @@ +/* PR target/69255 */ +/* { dg-do compile } */ +/* { dg-options "-msse4 -mno-avx" } */ + +#pragma GCC target "avx512vl" +#pragma GCC target "no-avx512vl" +__attribute__ ((__vector_size__ (32))) long long a; +__attribute__ ((__vector_size__ (16))) int b; + +void +foo (const long long *p) +{ + a = __builtin_ia32_gather3siv4di (a, p, b, 1, 1); /* { dg-error "needs isa option -m32 -mavx512vl" } */ +} + +/* { dg-warning "AVX vector return without AVX enabled changes the ABI" "" { target *-*-* } 13 } */ +/* { dg-warning "AVX vector argument without AVX enabled changes the ABI" "" { target *-*-* } 13 } */ diff --git a/gcc/testsuite/gcc.target/i386/pr69255-2.c b/gcc/testsuite/gcc.target/i386/pr69255-2.c new file mode 100644 index 00000000000..28eb57bbfcc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr69255-2.c @@ -0,0 +1,17 @@ +/* PR target/69255 */ +/* { dg-do compile } */ +/* { dg-options "-msse4 -mno-avx" } */ + +#pragma GCC target "avx512vl" +#pragma GCC target "" +__attribute__ ((__vector_size__ (32))) long long a; +__attribute__ ((__vector_size__ (16))) int b; + +void +foo (const long long *p) +{ + __builtin_ia32_gather3siv4di (a, p, b, 1, 1); /* { dg-error "needs isa option -m32 -mavx512vl" } */ +} + +/* { dg-warning "AVX vector return without AVX enabled changes the ABI" "" { target *-*-* } 13 } */ +/* { dg-warning "AVX vector argument without AVX enabled changes the ABI" "" { target *-*-* } 13 } */ diff --git a/gcc/testsuite/gcc.target/i386/pr69255-3.c b/gcc/testsuite/gcc.target/i386/pr69255-3.c new file mode 100644 index 00000000000..41fb4a2cf50 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr69255-3.c @@ -0,0 +1,17 @@ +/* PR target/69255 */ +/* { dg-do compile } */ +/* { dg-options "-msse4 -mno-avx" } */ + +#pragma GCC target "avx512vl" +#pragma GCC target "" +__attribute__ ((__vector_size__ (32))) long long a; +__attribute__ ((__vector_size__ (16))) int b; + +void +foo (const long long *p, __attribute__ ((__vector_size__ (32))) long long *q) +{ + *q = __builtin_ia32_gather3siv4di (a, p, b, 1, 1); /* { dg-error "needs isa option -m32 -mavx512vl" } */ +} + +/* { dg-warning "AVX vector return without AVX enabled changes the ABI" "" { target *-*-* } 13 } */ +/* { dg-warning "AVX vector argument without AVX enabled changes the ABI" "" { target *-*-* } 13 } */ -- 2.30.2