diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c5789365d3b..eb371d0eb8c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -21989,6 +21989,10 @@ ix86_libgcc_floating_mode_supported_p (scalar_float_mode mode) static bool ix86_vector_mode_supported_p (machine_mode mode) { + /* For ia32, scalar TImode isn't supported and so V1TImode shouldn't be + either. */ + if (!TARGET_64BIT && GET_MODE_INNER (mode) == TImode) + return false; if (TARGET_SSE && VALID_SSE_REG_MODE (mode)) return true; if (TARGET_SSE2 && VALID_SSE2_REG_MODE (mode)) diff --git a/gcc/testsuite/gcc.target/i386/pr103020.c b/gcc/testsuite/gcc.target/i386/pr103020.c new file mode 100644 index 00000000000..75253c72c9a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr103020.c @@ -0,0 +1,11 @@ +/* PR target/103020 */ +/* { dg-do compile { target { ! int128 } } } */ +/* { dg-additional-options "-mavx512f" } */ + +typedef int TI __attribute__((mode (TI))); /* { dg-error "unable to emulate" } */ +typedef int V1TI __attribute__((mode (V1TI))); /* { dg-error "unable to emulate" } */ +typedef int V2TI __attribute__((mode (V2TI))); /* { dg-error "unable to emulate" } */ +typedef int V4TI __attribute__((mode (V4TI))); /* { dg-error "unable to emulate" } */ +/* { dg-warning "is deprecated" "V1TI" { target *-*-* } .-3 } */ +/* { dg-warning "is deprecated" "V2TI" { target *-*-* } .-3 } */ +/* { dg-warning "is deprecated" "V4TI" { target *-*-* } .-3 } */