Home » U++ Library support » U++ MT-multithreading and servers » MT with speed optimization fails
MT with speed optimization fails [message #24827] |
Sun, 31 January 2010 22:26 |
|
Hi!
I encountered a MT related bug while building theide. In speed mode, with flags GUI, NOGTK and MT flags, linking fails withundefined reference to 'Upp::ReadMemoryBarrier()' .
With optimal mode, there is no problem. Also adding SSE2 removes the problem.
The function ReadMemoryBarrier() is defined in Core/MT.cpp, on line 266 as inlined. As far as I can tell that is the problem. If I remove the inline keyword, everything compiles correctly. I'm almost sure, that this issue is a result of the speed optimizations. For some reasons WriteMemoryBarrier is not defined as inline and works fine. If inline is added, 'undefined reference' appears when linking in speed mode.
I believe either ReadMemoryBarrier() should not be inline or both Read- and Write- should be inline and moved to MT.h, in similar manner as they are defined for SSE2 enabled case. I tried this and I attach the modified files. Please note that I don't have any idea about how the code works and I'm not sure if it won't cause any performance troubles! It just works and appears to me to represent equivalent code.
Additional info: I have i386 processor (Intel Atom) and use gcc4.4.3 on Arch Linux.$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,ada
--enable-threads=posix --mandir=/usr/share/man --infodir=/usr/share/info --enable-__cxa_atexit
--disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch
--with-tune=generic
Thread model: posix
gcc version 4.4.3 (GCC)
Best regards,
Honza
-
Attachment: MT.zip
(Size: 6.31KB, Downloaded 237 times)
|
|
|
Goto Forum:
Current Time: Sun Apr 28 20:12:22 CEST 2024
Total time taken to generate the page: 0.05317 seconds
|