[Bug c++/94671] New: Wrong behavior with operator new overloading when using O2 for optimization

2020-04-20 Thread b...@odd-e.com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: b...@odd-e.com Target Milestone: --- This bug is a similar bug as an earlier reported in clang: https://bugs.llvm.org/show_bug.cgi?id=15541 When having the overloaded new

[Bug c++/94671] Wrong behavior with operator new overloading when using O2 for optimization

2020-04-20 Thread b...@odd-e.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94671 --- Comment #2 from Bas Vodde --- Oh wow, does this mean that it is the choice of the compiler to actually call an overloaded operator new ? That is interesting. Thanks. I'd still consider it highly surprising behavior, at least it was for me.

[Bug c++/94671] Wrong behavior with operator new overloading when using O2 for optimization

2020-04-20 Thread b...@odd-e.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94671 --- Comment #4 from Bas Vodde --- The newCalled to true in the example was the simplest way to show the behavior. This bug came up in a open source project called CppuTest. This has the functionality to detect memory leaks and does so by overlo

[Bug c++/94671] Wrong behavior with operator new overloading when using O2 for optimization

2020-04-20 Thread b...@odd-e.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94671 --- Comment #5 from Bas Vodde --- In the case we found this, it mostly uses the overload for accounting and thus it doesn't cause a serious problem ('just' a test failure). If you use the overloaded new/delete for providing your own memory mana

[Bug c++/94671] Wrong behavior with operator new overloading when using O2 for optimization

2020-04-20 Thread b...@odd-e.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94671 --- Comment #9 from Bas Vodde --- Hi Jonathan, You are right, I was drawing much too many conclusions there. I should have waited with that comment until I slept :) Sorry for that. And it has been a while since I read the proposal, it has been

[Bug c++/57632] New: Operator new overloads with stdc++11 enabled looses exception specifier (MacOsX)

2013-06-16 Thread b...@odd-e.com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: b...@odd-e.com G++ on MacOsX acts different when enabling the new c++11 related to operator new overloads. If I compile the following code: #include "stdlib.h"

[Bug c++/57632] Operator new overloads with stdc++11 enabled looses exception specifier (MacOsX)

2013-06-17 Thread b...@odd-e.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57632 --- Comment #3 from Bas Vodde --- Thanks for the comments. I understand the problems in implementing a compiler, when this is also unclear in the language itself. Whatever is decided related to this, it would probably be a good idea to give a be