From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8185 invoked by alias); 28 Oct 2011 19:37:59 -0000 Received: (qmail 8172 invoked by uid 22791); 28 Oct 2011 19:37:58 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Oct 2011 19:37:45 +0000 From: "xunxun1982 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/50905] New: Gcc4.6.x's -ftree-parallelize-loops is effective only when using "-O2/-O3 -ffast-math" Date: Fri, 28 Oct 2011 19:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xunxun1982 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg03018.txt.bz2 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: unassigned@gcc.gnu.org ReportedBy: xunxun1982@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.