[Bug libgcc/56101] pthread program abort

siddhesh at redhat dot com gcc-bugzilla@gcc.gnu.org
Sat May 18 13:04:00 GMT 2013


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

--- Comment #3 from Siddhesh Poyarekar <siddhesh at redhat dot com> ---
Here's the simplified non-preprocessed test, since it's not a problem with the
compiler proper:

$ cat > tmain.C
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>

extern "C"
void *worker_thread(void *tap)
{
   int j[1] = { 0 }; 

   j[0] += *(int *)tap;

  pthread_exit(NULL);
  return NULL;
}

int main(void)
{
  pthread_t t;
  int targs;

  if (pthread_create(&t, NULL, worker_thread, &targs) != 0)
    exit(-1);

  return(pthread_join(t, NULL));
}



More information about the Gcc-bugs mailing list