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: Fix warnings in boehm-gc/mark.c


"Boehm, Hans" <hans.boehm@hp.com> writes:

> Thanks.
>
> I merged a modified version of this into the upstream sources.  I tried to
> consistently pass a ptr_t to the PREFETCH macros, and got rid of some of
> the casts in the PREFETCH implementations.

Thanks!

> I'm fine with putting your version into the gcc tree for now, if you haven't
> done so already.  The other cleanups will make it in the next merge.  (And
> they don't avoid warnings, and hence are far less important.)

I haven't committed them - but need somebody to approve this.

So, GCC Developers: Ok to commit this patch now?

Andreas


> Hans
>
>> -----Original Message-----
>> From: Andreas Jaeger [mailto:aj@suse.de]
>> Sent: Tuesday, April 20, 2004 12:53 AM
>> To: gcc-patches@gcc.gnu.org; java-patches@gcc.gnu.org
>> Cc: Hans Boehm
>> Subject: Fix warnings in boehm-gc/mark.c
>> 
>> 
>> 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
>> 
>
>

Andreas
-- 
 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

Attachment: pgp00000.pgp
Description: PGP signature


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