This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/85927] ud2 instruction generated starting with gcc 8
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 25 May 2018 21:36:03 +0000
- Subject: [Bug target/85927] ud2 instruction generated starting with gcc 8
- Auto-submitted: auto-generated
- References: <bug-85927-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85927
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't see the issue with the ud2 instruction here. The only valid thing is
for basic inline-asm statements in the functions which have the naked
attribute. It is undefined if using anything besides basic inline-asm as
documented in the documentation. ud2 is basically a trap to force the
developer to return from the function inside the basic inline-asm. The
original code had two undefined issues:
1) Used extended inline-asm
2) Use C code
GCC decided it was just undefined at runtime rather to reject it at compile
time. Unlike clang which decided to reject it at compile time.