https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98220
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|NEW |RESOLVED
--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> ---
It's the order fiasco, one can see it also without LTO:
g++ -std=c++11 -Wall -g -o main.o -c main.cpp
g++ -std=c++11 -Wall -g -o module.o -c module.cpp
g++ -std=c++11 -Wall -g -o moduleA.o -c moduleA.cpp
g++ -std=c++11 -Wall -g -o moduleB.o -c moduleB.cpp
g++ -std=c++11 -Wall -g -o test main.o module.o moduleA.o moduleB.o
$ g++ -std=c++11 -Wall -g -o test main.o moduleA.o moduleB.o module.o &&
./test
Floating point exception (core dumped)
(I changed the order of linked objects).