[Bug c++/70018] Possible issue around IPO and C++ inline functions

2016-02-29 Thread sanjoy at playingwithpointers dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70018 --- Comment #6 from Sanjoy Das --- (In reply to Andrew Pinski from comment #5) > Oh I see pure/const behavior. > > The problem is more complex, in that in one TU, the comdat function is > figured out to be pure/const so we remove the store befor

[Bug c++/70018] Possible issue around IPO and C++ inline functions

2016-02-29 Thread sanjoy at playingwithpointers dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70018 --- Comment #4 from Sanjoy Das --- (In reply to Andrew Pinski from comment #2) > So in summary what you are seeing is two effects going into effect here: > undefined behavior of division by 0 and ODR. There is no division by zero (or any other

[Bug c++/70018] Possible issue around IPO and C++ inline functions

2016-02-29 Thread sanjoy at playingwithpointers dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70018 --- Comment #3 from Sanjoy Das --- (In reply to Andrew Pinski from comment #1) > In C++ code, the one definition rule says that all TU that contains an > inline function, they need to have the same definition. If they have > different definition

[Bug c++/70018] New: Possible issue around IPO and C++ inline functions

2016-02-29 Thread sanjoy at playingwithpointers dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sanjoy at playingwithpointers dot com Target Milestone: --- I don't grok gcc internals so I cannot write a terribly well-informed bug report, but GCC 5.3.0 seems to miscompile https://github.com/sanjoy/comdat-ipo