diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-11-22 11:33:34 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2024-11-22 11:33:34 +0100 |
commit | d6d1fdcf953a79d1e3ef2d28c99c1933d1e07d80 (patch) | |
tree | e47e8b2aed6bafdcbef099eeef52b151bad59860 /gcc | |
parent | 77f4b1097e6aec50053577a8a1a65487ed58cbb0 (diff) | |
download | gcc-d6d1fdcf953a79d1e3ef2d28c99c1933d1e07d80.zip gcc-d6d1fdcf953a79d1e3ef2d28c99c1933d1e07d80.tar.gz gcc-d6d1fdcf953a79d1e3ef2d28c99c1933d1e07d80.tar.bz2 |
i386: Make __builtin_ia32_f{nstenv,ldenv,nstsw,fnclex} builtins internal [PR117165]
As the comment says, these builtins are meant to be internal for the atomic
support and cause various ICEs when using them directly in various
conditions.
So the following patch makes them internal.
We do have also internal-fn.*, but those target specific builtins would
need to be there in generic code, so I've just added space to their name,
which is the old way to hide builtins/attributes etc.
2024-11-22 Jakub Jelinek <jakub@redhat.com>
PR target/117165
* config/i386/i386-builtin.def (IX86_BUILTIN_FNSTENV,
IX86_BUILTIN_FLDENV, IX86_BUILTIN_FNSTSW, IX86_BUILTIN_FNCLEX): Add
space to the end of the builtin name to make it really internal.
* gcc.target/i386/pr117165.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/i386/i386-builtin.def | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr117165.c | 27 |
2 files changed, 31 insertions, 4 deletions
diff --git a/gcc/config/i386/i386-builtin.def b/gcc/config/i386/i386-builtin.def index 26c2378..d4fa87c 100644 --- a/gcc/config/i386/i386-builtin.def +++ b/gcc/config/i386/i386-builtin.def @@ -94,10 +94,10 @@ BDESC (0, 0, CODE_FOR_nothing, "__builtin_ia32_rdpmc", IX86_BUILTIN_RDPMC, UNKNO BDESC (0, 0, CODE_FOR_pause, "__builtin_ia32_pause", IX86_BUILTIN_PAUSE, UNKNOWN, (int) VOID_FTYPE_VOID) /* 80387 (for use internally for atomic compound assignment). */ -BDESC (0, 0, CODE_FOR_fnstenv, "__builtin_ia32_fnstenv", IX86_BUILTIN_FNSTENV, UNKNOWN, (int) VOID_FTYPE_PVOID) -BDESC (0, 0, CODE_FOR_fldenv, "__builtin_ia32_fldenv", IX86_BUILTIN_FLDENV, UNKNOWN, (int) VOID_FTYPE_PCVOID) -BDESC (0, 0, CODE_FOR_fnstsw, "__builtin_ia32_fnstsw", IX86_BUILTIN_FNSTSW, UNKNOWN, (int) USHORT_FTYPE_VOID) -BDESC (0, 0, CODE_FOR_fnclex, "__builtin_ia32_fnclex", IX86_BUILTIN_FNCLEX, UNKNOWN, (int) VOID_FTYPE_VOID) +BDESC (0, 0, CODE_FOR_fnstenv, "__builtin_ia32_fnstenv ", IX86_BUILTIN_FNSTENV, UNKNOWN, (int) VOID_FTYPE_PVOID) +BDESC (0, 0, CODE_FOR_fldenv, "__builtin_ia32_fldenv ", IX86_BUILTIN_FLDENV, UNKNOWN, (int) VOID_FTYPE_PCVOID) +BDESC (0, 0, CODE_FOR_fnstsw, "__builtin_ia32_fnstsw ", IX86_BUILTIN_FNSTSW, UNKNOWN, (int) USHORT_FTYPE_VOID) +BDESC (0, 0, CODE_FOR_fnclex, "__builtin_ia32_fnclex ", IX86_BUILTIN_FNCLEX, UNKNOWN, (int) VOID_FTYPE_VOID) /* MMX */ BDESC (OPTION_MASK_ISA_MMX, 0, CODE_FOR_mmx_emms, "__builtin_ia32_emms", IX86_BUILTIN_EMMS, UNKNOWN, (int) VOID_FTYPE_VOID) diff --git a/gcc/testsuite/gcc.target/i386/pr117165.c b/gcc/testsuite/gcc.target/i386/pr117165.c new file mode 100644 index 0000000..d1f9663 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr117165.c @@ -0,0 +1,27 @@ +/* PR target/117165 */ +/* { dg-do compile } */ +/* { dg-options "-msoft-float" } */ + +void +foo () +{ + __builtin_ia32_fnstsw (); /* { dg-error "implicit declaration of function" } */ +} + +void +bar () +{ + __builtin_ia32_fnclex (); /* { dg-error "implicit declaration of function" } */ +} + +void +baz () +{ + __builtin_ia32_fnstenv (0); /* { dg-error "implicit declaration of function" } */ +} + +void +qux () +{ + __builtin_ia32_fldenv (0); /* { dg-error "implicit declaration of function" } */ +} |