[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 pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70018 Andrew Pinski changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID

[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] Possible issue around IPO and C++ inline functions

2016-02-29 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70018 --- Comment #2 from Andrew Pinski --- Also one more point, in this example both inline functions have the same definition. Both answers are valid answers for this case. That is doing the division (causing the trap on x86_64) don't have to happe

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

2016-02-29 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70018 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---