This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/20099] -pthreads should imply -fno-threadsafe-statics


------- Additional Comments From qrczak at knm dot org dot pl  2005-02-23 01:53 -------
> The '-pthreads' flag should imply '-fno-threadsafe-statics'. For every other
> similar flag I can find, the default is to permit the compiler to make the
> optimizations that standard allows and specific flags are needed to disable the
> optimization.

It's not the question of optimization but correctness. Having an "initialize on
first use" semantics which breaks when multiple threads use it is as wrong as
using global variables for passing data between functions and forcing clients to
introduce locks to make them reentrant. It is usable when clients are careful,
but it's a bad default when we can't expect all calls to be done from a single
thread.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20099


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]