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]

gcc 3.[01] PATCH: gc_priv.h Patch


Compiling gcc 3.1 configured with "--enable-shared --enable-threads
--enable-languages=c++,java" revealed an error fixed by this patch,
applied to both gcc 3.0 and 3.1.

2001-05-01  Jeffrey Oldham  <oldham@codesourcery.com>

        * gc_priv.h (UNLOCK): Change type of GC_noop1 argument.
        (GC_noop1): Change declaration to take one argument.

Tested on       i686-pc-linux-gnu and mips-sgi-irix6.5
Approved by     Tom Tromey (tromey@redhat.com)

Thanks,
Jeffrey D. Oldham
oldham@codesourcery.com
Index: gc_priv.h
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/gc_priv.h,v
retrieving revision 1.14.4.1
diff -c -p -r1.14.4.1 gc_priv.h
*** gc_priv.h	2001/04/05 00:13:13	1.14.4.1
--- gc_priv.h	2001/05/01 02:36:24
*************** void GC_print_callers (/* struct callinf
*** 628,634 ****
  #    ifdef HPUX_THREADS
  #      define LOCK() { if (!GC_test_and_clear(&GC_allocate_lock)) GC_lock(); }
         /* The following is INCORRECT, since the memory model is too weak. */
! #      define UNLOCK() { GC_noop1(&GC_allocate_lock); \
  			*(volatile unsigned long *)(&GC_allocate_lock) = 1; }
  #    else
  #      define LOCK() { if (GC_test_and_set(&GC_allocate_lock, 1)) GC_lock(); }
--- 628,634 ----
  #    ifdef HPUX_THREADS
  #      define LOCK() { if (!GC_test_and_clear(&GC_allocate_lock)) GC_lock(); }
         /* The following is INCORRECT, since the memory model is too weak. */
! #      define UNLOCK() { GC_noop1((word)&GC_allocate_lock); \
  			*(volatile unsigned long *)(&GC_allocate_lock) = 1; }
  #    else
  #      define LOCK() { if (GC_test_and_set(&GC_allocate_lock, 1)) GC_lock(); }
*************** void GC_print_callers (/* struct callinf
*** 641,647 ****
  	    /* This is probably not necessary for ucode or gcc 2.8.	*/
  	    /* It may be necessary for Ragnarok and future gcc		*/
  	    /* versions.						*/
! #           define UNLOCK() { GC_noop1(&GC_allocate_lock); \
  			*(volatile unsigned long *)(&GC_allocate_lock) = 0; }
  #      endif
  #    endif
--- 641,647 ----
  	    /* This is probably not necessary for ucode or gcc 2.8.	*/
  	    /* It may be necessary for Ragnarok and future gcc		*/
  	    /* versions.						*/
! #           define UNLOCK() { GC_noop1((word)&GC_allocate_lock); \
  			*(volatile unsigned long *)(&GC_allocate_lock) = 0; }
  #      endif
  #    endif
*************** void GC_dump();
*** 1851,1857 ****
    GC_API void GC_noop();
  # endif
  
! void GC_noop1(/* word arg */);
  
  /* Logging and diagnostic output: 	*/
  GC_API void GC_printf GC_PROTO((char * format, long, long, long, long, long, long));
--- 1851,1857 ----
    GC_API void GC_noop();
  # endif
  
! void GC_noop1 GC_PROTO((word));
  
  /* Logging and diagnostic output: 	*/
  GC_API void GC_printf GC_PROTO((char * format, long, long, long, long, long, long));

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