During an LTO/PGO Firefox build one gets countless warnings:
  warning: -fprefetch-loop-arrays is not supported with -Os

This happens because flag_prefetch_loop_arrays is always set during the
profile-use phase.
Fix by following the suggestion of Jakub and disable prefetching of
loop_arrays when optimizing for size.

Please apply if the patch looks OK.
Thanks.

2013-08-30  Markus Trippelsdorf  <mar...@trippelsdorf.de>

        * config/i386/i386.c (ix86_option_override_internal): Only
        prefetch loop_arrays during profile_use when not optimizing for
        size.

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a8d70bc..f385db4 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3952,7 +3952,7 @@ ix86_option_override_internal (bool main_args_p)
   /* Enable sw prefetching at -O3 for CPUS that prefetching is helpful.  */
   if (flag_prefetch_loop_arrays < 0
       && HAVE_prefetch
-      && (optimize >= 3 || flag_profile_use)
+      && (optimize >= 3 || (flag_profile_use && !optimize_size))
       && TARGET_SOFTWARE_PREFETCHING_BENEFICIAL)
     flag_prefetch_loop_arrays = 1;
 

-- 
Markus

Reply via email to