This is dependant on bug 32261. g++ -g -O3 gccbug.cpp -pthread -o gccbug -s #include <pthread.h> #include <string> void* thread_function(void*) { for (int k = 0; k < 50000; k++) { std::string my_str; my_str += "foo"; } return 0; } int main() { pthread_t thread1, thread2; pthread_create(&thread1, NULL, thread_function, NULL); pthread_create(&thread2, NULL, thread_function, NULL); void* exitcode; pthread_join(thread1, &exitcode); pthread_join(thread2, &exitcode); return 0; }
Confirmed.
Author: redi Date: Tue Mar 24 14:47:32 2015 New Revision: 221635 URL: https://gcc.gnu.org/viewcvs?rev=221635&root=gcc&view=rev Log: PR libstdc++/33394 * testsuite/21_strings/basic_string/pthread33394.cc: Add test. # Auto-generated commit message above this line, original below. PR libstdc++/33394 * testsuite/21_strings/basic_string/pthread33394.cc: Add test. Added: trunk/libstdc++-v3/testsuite/21_strings/basic_string/pthread33394.cc Modified: trunk/libstdc++-v3/ChangeLog
Testcase added.
Author: alalaw01 Date: Wed Mar 25 15:46:58 2015 New Revision: 221666 URL: https://gcc.gnu.org/viewcvs?rev=221666&root=gcc&view=rev Log: PR libstdc++/33394 * testsuite/21_strings/basic_string/pthread33394.cc: Use dg-additional-options. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/testsuite/21_strings/basic_string/pthread33394.cc