[PATCH] Fix boehm-gc crash on s390x

Ulrich Weigand weigand@i1.informatik.uni-erlangen.de
Tue Oct 19 13:13:00 GMT 2004


Hello,

gctest crashes on s390x-ibm-linux because GC_gcj_fast_malloc calls
GC_generic_malloc_words_small_inner without having a prototype for
the latter in scope.  This causes the return type to be assumed as
'int', and the high bits of the returned pointer are clobbered.

Fixed by providing a prototype in gc_priv.h.

(This would have been easier to find if boehm-gc was built with
warnings enabled ...)

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux.
OK for mainline?

Bye,
Ulrich


ChangeLog:

	* include/private/gc_priv.h (GC_generic_malloc_words_small_inner):
	Add prototype.

Index: boehm-gc/include/private/gc_priv.h
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/include/private/gc_priv.h,v
retrieving revision 1.15
diff -c -p -r1.15 gc_priv.h
*** boehm-gc/include/private/gc_priv.h	28 Aug 2004 00:41:41 -0000	1.15
--- boehm-gc/include/private/gc_priv.h	18 Oct 2004 22:28:42 -0000
*************** ptr_t GC_generic_malloc_ignore_off_page 
*** 1632,1637 ****
--- 1632,1641 ----
    				/* are ignored.				*/
  ptr_t GC_generic_malloc_inner GC_PROTO((word lb, int k));
    				/* Ditto, but I already hold lock, etc.	*/
+ ptr_t GC_generic_malloc_words_small_inner GC_PROTO((word lw, int k));
+ 				/* Analogous to the above, but assumes	*/
+ 				/* a small object size, and bypasses	*/
+ 				/* MERGE_SIZES mechanism.		*/
  ptr_t GC_generic_malloc_words_small GC_PROTO((size_t lw, int k));
    				/* As above, but size in units of words */
    				/* Bypasses MERGE_SIZES.  Assumes	*/
-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de



More information about the Gcc-patches mailing list