http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58250
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Markus Trippelsdorf from comment #0) > Just noticed this issue during a PGO/LTO Firefox build. > During the -fprofile-use phase I always get the following warning: > warning: -fprefetch-loop-arrays is not supported with -Os [enabled by > default] > > This is caused by rev.193135: > /* Enable sw prefetching at -O3 for CPUS that prefetching is helpful. */ > if (flag_prefetch_loop_arrays < 0 > && HAVE_prefetch > - && optimize >= 3 > + && (optimize >= 3 || flag_profile_use) > && TARGET_SOFTWARE_PREFETCHING_BENEFICIAL) > flag_prefetch_loop_arrays = 1; > > > Does the following patch look OK? > > diff --git a/gcc/toplev.c b/gcc/toplev.c > index 53f53fd..9955ed4 100644 > --- a/gcc/toplev.c > +++ b/gcc/toplev.c > @@ -1506,7 +1506,7 @@ process_options (void) > > /* This combination of options isn't handled for i386 targets and doesn't > make much sense anyway, so don't allow it. */ > - if (flag_prefetch_loop_arrays > 0 && optimize_size) > + if (flag_prefetch_loop_arrays > 0 && optimize_size && !flag_profile_use) > { > warning (0, "-fprefetch-loop-arrays is not supported with -Os"); > flag_prefetch_loop_arrays = 0; Hmm, I rather question this hunk - where does it come from? Why is prefetching "unsupported" at -Os?