This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Patch to Avoid Bad Prefetching


Here is a fix. It bootstrapped on my Linux Barcelona machine. Is it OK for check in?


Index: tree-ssa-loop-prefetch.c
===================================================================
--- tree-ssa-loop-prefetch.c	(revision 148293)
+++ tree-ssa-loop-prefetch.c	(working copy)
@@ -1583,10 +1583,11 @@ loop_prefetch_arrays (struct loop *loop)
   unroll_factor = determine_unroll_factor (loop, refs, ninsns, &desc,
 					   est_niter);
   if (dump_file && (dump_flags & TDF_DETAILS))
-    fprintf (dump_file, "Ahead %d, unroll factor %d, trip count %ld\n"
+    fprintf (dump_file, "Ahead %d, unroll factor %d, trip count " 
+	     HOST_WIDE_INT_PRINT_DEC "\n"
 	     "insn count %d, mem ref count %d, prefetch count %d\n", 
-	     ahead, unroll_factor, est_niter, ninsns, mem_ref_count, 
-	     prefetch_count);
+	     ahead, unroll_factor, est_niter, 
+	     ninsns, mem_ref_count, prefetch_count);    
 
   if (!is_loop_prefetching_profitable (ahead, est_niter, ninsns, 
 				       prefetch_count, mem_ref_count))


And here is the ChangeLog Entry:

2009-06-08  Ghassan Shobaki  <ghassan.shobaki@amd.com>
	
	* tree-ssa-loop-prefetch.c 
	(loop_prefetch_arrays): Fixed a portability problem in printf format 
        string.

Thanks
-Ghassan


-----Original Message-----
From: Andrew Pinski [mailto:pinskia@gmail.com] 
Sent: Monday, June 08, 2009 11:17 AM
To: Richard Guenther
Cc: Shobaki, Ghassan; Zdenek Dvorak; gcc-patches@gcc.gnu.org
Subject: Re: Patch to Avoid Bad Prefetching

On Fri, Jun 5, 2009 at 11:01 AM, Richard
Guenther<richard.guenther@gmail.com> wrote:
> On Fri, Jun 5, 2009 at 4:53 PM, Shobaki, Ghassan<Ghassan.Shobaki@amd.com> wrote:
>> A ChangeLog entry was included in the original email. Here it is again. Does it look OK?
>
> It misses the doc/invoke.texi changes but otherwise looks ok.

This causes a bootstrap issue on powerpc-darwin:
/Users/regress/tbox/svn-gcc/gcc/tree-ssa-loop-prefetch.c:1589:7:
error: format '%ld' expects type 'long int', but argument 5 has type
'long long int'

%ld should not be used for HOST_WIDE_INT but rather
HOST_WIDE_INT_PRINT_DEC should be used.

Thanks,
Andrew Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]