This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/81580] [ARM] C++ zero-sized array generates undefined instruction.


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]