This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81580] [ARM] C++ zero-sized array generates undefined instruction.
- From: "ktkachov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 27 Jul 2017 09:28:26 +0000
- Subject: [Bug target/81580] [ARM] C++ zero-sized array generates undefined instruction.
- Auto-submitted: auto-generated
- References: <bug-81580-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81580
ktkachov at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |ktkachov at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #1 from ktkachov at gcc dot gnu.org ---
That inst is the trap instruction that is inserted by the isolate-paths pass
because it detects undefined behaviour.
While the result of calling data() is unspecified, this is not what the
testcase is doing. It's using operator[] which performs an access to the
underlying storage directly and is thus out of bounds and undefined