From 8b1f4e1f8aec774a185fe1f315ad4361161d5dc3 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 26 Nov 2018 22:26:19 +0100 Subject: [PATCH] re PR target/88195 (misleading error message for unsupported builtin) PR target/88195 * config/i386/i386.c (def_builtin2): If tcode == VOID_FTYPE_UINT64 and !TARGET_64BIT, return NULL_TREE. * gcc.target/i386/pr88195.c: New test. From-SVN: r266487 --- gcc/ChangeLog | 4 ++++ gcc/config/i386/i386.c | 8 ++++++-- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.target/i386/pr88195.c | 8 ++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr88195.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42f2ff059e3..2d7bcb83f33 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2018-11-26 Jakub Jelinek + PR target/88195 + * config/i386/i386.c (def_builtin2): If tcode == VOID_FTYPE_UINT64 + and !TARGET_64BIT, return NULL_TREE. + PR c++/86900 * dwarf2out.c (secname_for_decl): For functions with DECL_SECTION_NAME if in_cold_section_p, try to return diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 851598004cc..95abde95f89 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -30220,9 +30220,13 @@ def_builtin2 (HOST_WIDE_INT mask, const char *name, { tree decl = NULL_TREE; - ix86_builtins_isa[(int) code].isa2 = mask; if (tcode == VOID_FTYPE_UINT64) - ix86_builtins_isa[(int) code].isa = OPTION_MASK_ISA_64BIT; + { + if (!TARGET_64BIT) + return decl; + ix86_builtins_isa[(int) code].isa = OPTION_MASK_ISA_64BIT; + } + ix86_builtins_isa[(int) code].isa2 = mask; if (mask == 0 || (mask & ix86_isa_flags2) != 0 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4043524049d..47f8b199357 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-11-26 Jakub Jelinek + PR target/88195 + * gcc.target/i386/pr88195.c: New test. + PR testsuite/88090 * obj-c++.dg/attributes/method-nonnull-1.mm (my_size_t): New typedef. (MyArray::removeObjectAtIndex): Use my_size_t instead of size_t and diff --git a/gcc/testsuite/gcc.target/i386/pr88195.c b/gcc/testsuite/gcc.target/i386/pr88195.c new file mode 100644 index 00000000000..cd12adc063a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr88195.c @@ -0,0 +1,8 @@ +/* PR target/88195 */ +/* { dg-options "-mptwrite" } */ + +void +foo (void) +{ + __builtin_ia32_ptwrite64 (1); /* { dg-warning "implicit declaration of function" "" { target ia32 } } */ +} -- 2.30.2