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 c++/61421] Invalid -O2 optimization breaks program


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61421

--- Comment #9 from mimamer at gmail dot com ---
Now that I have read enough about aliasing rules I realize that they are
considerably fucked up and that their is no way to efficiently downcast without
violating strict aliasing rules. In explanation, you need to copy your data out
and back (which takes time), or implement an instance of a derived class in the
first place (which consumes memory). Yes, my code is efficiency-critical.
Hooray for retarded aliasing rules. (If I don't care about efficiency I could
just as well switch to Java, which gives all the safety that one needs.)


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