[Bug libstdc++/103629] Possible miscompilation visible using pthread + exception

2021-12-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103629 --- Comment #18 from Andrew Pinski --- Could Visibility not being applied correctly to lambdas but does that matter?

[Bug libstdc++/103629] Possible miscompilation visible using pthread + exception

2021-12-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103629 --- Comment #17 from Jonathan Wakely --- The difference is due to this change in std::call_once - __once_callable = std::__addressof(__callable); // NOLINT: PR 82481 - __once_call = []{ (*(decltype(__callable)*)__once_callable)(); };

[Bug libstdc++/103629] Possible miscompilation visible using pthread + exception

2021-12-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103629 --- Comment #16 from Jonathan Wakely --- With GCC 10 the same object gets used in the lambda and outside it: 0x7f52ed99f090 0x7f52ed99f090

[Bug libstdc++/103629] Possible miscompilation visible using pthread + exception

2021-12-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103629 --- Comment #15 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #12) > Simple makefile for comment 8: A better one: CXXFLAGS := -fvisibility=hidden -fvisibility-inlines-hidden -g LDFLAGS := '-Wl,-rpath,$$ORIGIN' -pthread -L.

[Bug libstdc++/103629] Possible miscompilation visible using pthread + exception

2021-12-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103629 --- Comment #14 from Jonathan Wakely --- So one copy of that variable gets initialized, and a different copy gets dereferenced, so it dereferences null. If you change Tree.h to: #pragma once #include #include #include class Tree { public:

[Bug libstdc++/103629] Possible miscompilation visible using pthread + exception

2021-12-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103629 --- Comment #13 from Jonathan Wakely --- Inside the lambda run by std::call_once, the address of sTreeTypeName is 0x404098, but after std::call_once finishes, the address of the object being dereferenced is 0x77fc2090

[Bug libstdc++/103629] Possible miscompilation visible using pthread + exception

2021-12-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103629 --- Comment #12 from Jonathan Wakely --- Simple makefile for comment 8: CXXFLAGS := -fvisibility=hidden -fvisibility-inlines-hidden vdb_view: main.o Module.o libopenvdb.so $(CXX) -o $@ $^ -pthread '-Wl,-rpath,$$ORIGIN' libopenvdb.so: o

[Bug libstdc++/103629] Possible miscompilation visible using pthread + exception

2021-12-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103629 --- Comment #11 from Andrew Pinski --- Plus please don't use cmake and just make a simple makefile for testcases like this cnake brings in a lot of crap for no reason.