Fix warnings in boehm-gc/mark.c

Andreas Jaeger aj@suse.de
Tue Apr 20 07:53:00 GMT 2004


I get on mainline (Linux, AMD64) the following warning:
/cvs/gcc/boehm-gc/mark.c:687: warning: passing arg 1 of `__builtin_prefetch' makes pointer from integer without a cast
/cvs/gcc/boehm-gc/mark.c:763: warning: passing arg 1 of `__builtin_prefetch' makes pointer from integer without a cast
/cvs/gcc/boehm-gc/mark.c:773: warning: passing arg 1 of `__builtin_prefetch' makes pointer from integer without a cast
/cvs/gcc/boehm-gc/mark.c:790: warning: passing arg 1 of `__builtin_prefetch' makes pointer from integer without a cast

The appended patch fixes these warnings.  Ok to commit to mainline?

Bootstrapped on Linux/AMD64, reg.testing in progress,

Andreas

2004-04-20  Andreas Jaeger  <aj@suse.de>

	* mark.c (GC_mark_from): Use pointer as prefetch argument.

============================================================
Index: boehm-gc/mark.c
--- boehm-gc/mark.c	28 Jul 2003 04:18:20 -0000	1.15
+++ boehm-gc/mark.c	20 Apr 2004 07:15:35 -0000
@@ -684,7 +684,7 @@ mse * mark_stack_limit;
               current = *current_p;
 	      FIXUP_POINTER(current);
 	      if ((ptr_t)current >= least_ha && (ptr_t)current < greatest_ha) {
-		PREFETCH(current);
+		PREFETCH((ptr_t)current);
                 HC_PUSH_CONTENTS((ptr_t)current, mark_stack_top,
 			      mark_stack_limit, current_p, exit1);
 	      }
@@ -760,7 +760,7 @@ mse * mark_stack_limit;
 	  FIXUP_POINTER(deferred);
 	  limit = (word *)((char *)limit - ALIGNMENT);
 	  if ((ptr_t)deferred >= least_ha && (ptr_t)deferred <  greatest_ha) {
-	    PREFETCH(deferred);
+	    PREFETCH((ptr_t)deferred);
 	    break;
 	  }
 	  if (current_p > limit) goto next_object;
@@ -770,7 +770,7 @@ mse * mark_stack_limit;
 	  FIXUP_POINTER(deferred);
 	  limit = (word *)((char *)limit - ALIGNMENT);
 	  if ((ptr_t)deferred >= least_ha && (ptr_t)deferred <  greatest_ha) {
-	    PREFETCH(deferred);
+	    PREFETCH((ptr_t)deferred);
 	    break;
 	  }
 	  if (current_p > limit) goto next_object;
@@ -787,7 +787,7 @@ mse * mark_stack_limit;
         if ((ptr_t)current >= least_ha && (ptr_t)current <  greatest_ha) {
   	  /* Prefetch the contents of the object we just pushed.  It's	*/
   	  /* likely we will need them soon.				*/
-  	  PREFETCH(current);
+  	  PREFETCH((ptr_t)current);
           HC_PUSH_CONTENTS((ptr_t)current, mark_stack_top,
   		           mark_stack_limit, current_p, exit2);
         }

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040420/a2c152a5/attachment.sig>


More information about the Gcc-patches mailing list