This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Fails for SPEC2006 using -O3 -ftree-parallelize-loops
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Sebastian Pop <sebpop at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 15 Dec 2007 10:41:21 +0100
- Subject: Re: Fails for SPEC2006 using -O3 -ftree-parallelize-loops
- References: <cb9d34b20712142012l76ec117ra4e442f92ef03cdc@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Dec 14, 2007 at 10:12:11PM -0600, Sebastian Pop wrote:
> I've run a build for spec cpu2006 with -O3 -ftree-parallelize-loops=16
> and interestingly there were some fails that I will investigate later.
> So I'm just reporting these, and asking for somebody who could fix
> the link options for autopar. I'm attaching a patch, not sure it will build.
> Before going in the depths of the build machinery, I'm asking if
> somebody could help with this.
There is a bunch of -ftree-parallelize-loops ICEs in gcc bugzilla already.
> For these a patch like this would be needed to automatically link the
> gomp and pthread libs.
>
> Index: gcc.c
> ===================================================================
> --- gcc.c (revision 130927)
> +++ gcc.c (working copy)
> @@ -721,6 +721,7 @@ proper position among the other output f
> %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
> %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
> %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
> + %{ftree-parallelize-loops=:%:include(libgomp.spec)%(link_gomp)}\
> %{fopenmp:%:include(libgomp.spec)%(link_gomp)} %(mflib)\
> %{fprofile-arcs|fprofile-generate|coverage:-lgcov}\
> %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
This should be:
- %{fopenmp:%:include(libgomp.spec)%(link_gomp)} %(mflib)\
+ %{fopenmp|ftree-parallelize-loops=:%:include(libgomp.spec)%(link_gomp)} %(mflib)\
instead, so that for -fopenmp -ftree-parallelize-loops=4 you don't get it
duplicated on the link line.
> @@ -873,8 +874,13 @@ static const char *const multilib_defaul
> #define GOMP_SELF_SPECS "%{fopenmp: -pthread}"
> #endif
>
> +#ifndef PARLOOPS_SELF_SPECS
> +#define PARLOOPS_SELF_SPECS "%{ftree-parallelize-loops=: -pthread}"
> +#endif
> +
> +
> static const char *const driver_self_specs[] = {
> - DRIVER_SELF_SPECS, GOMP_SELF_SPECS
> + DRIVER_SELF_SPECS, GOMP_SELF_SPECS, PARLOOPS_SELF_SPECS
> };
The same, just add |ftree-parallelize-loops= into GOMP_SELF_SPECS.
Jakub