http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50905
Bug #: 50905 Summary: Gcc4.6.x's -ftree-parallelize-loops is effective only when using "-O2/-O3 -ffast-math" Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: xunxun1...@gmail.com Created attachment 25648 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25648 the test I found that Gcc4.6.1 and Gcc4.6.2 -ftree-parallelize-loops is effective only when using "-O2/-O3 -ffast-math" on Windows or on Ubuntu. Is this right? Using my test, $gcc -ftree-parallelize-loops=2 -c main.c $nm main.o U clock 0000000000000000 T main U printf U puts U sin $gcc -O2 -ftree-parallelize-loops=2 -c main.c $nm main.o 0000000000000000 r .LC4 0000000000000008 r .LC6 U __printf_chk U clock 0000000000000000 T main U puts U sin $gcc -ffast-math -ftree-parallelize-loops=2 -c main.c $nm main.o U clock 0000000000000000 T main U printf U puts U sin $gcc -O2 -ftree-parallelize-loops=2 -ffast-math -c main.c $nm main.o 0000000000000000 r .LC5 U GOMP_parallel_end U GOMP_parallel_start U __printf_chk U clock 0000000000000000 T main 0000000000000000 t main._loopfn.0 U omp_get_num_threads U omp_get_thread_num U puts U sin Only -O2 -ftree-parallelize-loops=2 -ffast-math achieve my desired result. But I think it should generate the similar symbols below when using -ftree-parallelize-loops=2 alone: U GOMP_parallel_end U GOMP_parallel_start U omp_get_num_threads U omp_get_thread_num Am I right? Or the -ftree-parallelize-loops is such option that should be used with "-O2/-O3 -ffast-math"? Thanks.