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]

[tree-ssa mudflap] build, threading cleanups


Hi -

The following patches clear up that x86_64 threading problem I
mentioned in my previous message, some build problems, and
some portability cleanups.


+2003-06-11  Frank Ch. Eigler  <fche@redhat.com>
+
+	* mf-heuristics.c (__mf_heuristic_check): Disable stack_bounds 
+	heuristic for threaded case, and for non-x86-linux targets.
+	* mf-hooks.c (__mf_0fn_calloc): Provide a working dummy implementation
+	for use during pre-main() program startup.
+	(__mf_0fn_*): Make these functions non-static.
+	* mf-impl.h (DECLARE, CALL_REAL): Support calls to 0fn backup hook 
+	functions.
+	* mf-runtime.c (__mf_state): Set initial state to "starting".
+	(__mf_resolve_single_dynamic): Tolerate repeated calls for same symbol.
+	(__wrap_main): New function to register argv[] and environ[] strings.
+	(__mf_ini): Call it.
+	(*): In all trace functions, use "%p" as formatter for uintptr_t.
+
+	* testsuite/libmudflap.c/pass38-frag.c: New test case.
+	* testsuite/libmudflap.cth/pass37-frag.c: Improved test.
+	
+	* acinclude.m4: Add comments with aoliva's concerns about x86_64 
+	pass_all.
+	* aclocal.m4, configure: Regenerated.

> 2003-06-11  Frank Ch. Eigler  <fche@redhat.com>
> 
> 	* gcc.c (MFWRAP_SPEC): Always wrap main().
> 	* tree-mudflap.c (mudflap_enqueue_decl): Mark enqueued decls
> 	to prevent them from repeated processing.


Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/acinclude.m4,v
retrieving revision 1.1.2.4
diff -u -p -w -s -r1.1.2.4 acinclude.m4
--- acinclude.m4	4 Jun 2003 15:00:21 -0000	1.1.2.4
+++ acinclude.m4	11 Jun 2003 18:00:57 -0000
@@ -666,6 +666,9 @@ linux-gnu*)
   case $host_cpu in
   alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | x86_64*)
     lt_cv_deplibs_check_method=pass_all ;;
+    # NB 2003-06-03: According to Alexandre Oliva, x86_64 should not be
+    # in this list.  However, it works around a libtool problem that
+    # wrongly excludes -ldl/-lpthread from the libmudflap(th) dependencies.
   *)
     # glibc up to 2.1.1 does not perform some relocations on ARM
     lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;;
@@ -721,6 +724,10 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
 esac
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
+# NB: See above NB ... this is to make sure that the overriden
+#     local libtool variant doesn't pollute the upstream cache
+unset lt_cv_file_magic_cmd
+unset lt_cv_deplibs_check_method
 AC_MSG_RESULT($deplibs_check_method)
 ])
 
Index: mf-heuristics.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/mf-heuristics.c,v
retrieving revision 1.1.2.14
diff -u -p -w -s -r1.1.2.14 mf-heuristics.c
--- mf-heuristics.c	16 May 2003 19:56:55 -0000	1.1.2.14
+++ mf-heuristics.c	11 Jun 2003 18:00:58 -0000
@@ -22,29 +22,6 @@
 
 extern char _end;
 extern char _start;
-/* XXX: linux-x86 specific */
-static const uintptr_t stack_segment_base = 0xC0000000;
-static const uintptr_t stack_segment_top  = 0xBF800000;
-
-
-#if 0 /* if only glibc exported these */
-/* These are used by heur_argv_envp below.  */
-static int system_argc;
-static char **system_argv;
-static char **system_envp;
-
-/* Hack: intercept / override glibc's __init_misc routine to 
-   kidnap the process startup argc/argv/envp values. */
-void
-__init_misc (int argc, char **argv, char **envp)
-{
-  system_argc = argc;
-  system_argv = argv;
-  system_envp = envp;
-  /* XXX: would be nice to call over to the glibc __init_misc routine. */
-}
-#endif
-
 
 
 /* Run some quick validation of the given region.  
@@ -55,12 +32,23 @@ __mf_heuristic_check (uintptr_t ptr, uin
 {
   VERBOSE_TRACE ("mf: heuristic check\n");
 
-  /* The first heuristic is to check stack bounds.  Since this is a
-     transient condition and quick to check, don't cache its
-     result. */
+  /* XXX: Disable the stack bounding check for libmudflapth.  We do
+     actually have enough information to track stack bounds (see
+     __mf_pthread_info in mf-hooks.c), so with a bit of future work,
+     this heuristic can be turned on.  */
+#ifndef LIBMUDFLAPTH
+
+  /* The first heuristic is to check stack bounds.  This is a
+     transient condition and quick to check. */
   if (__mf_opts.heur_stack_bound)
     {
       uintptr_t stack_top_guess = (uintptr_t)__builtin_frame_address(0);
+#if defined(__i386__) && defined (__linux__)
+      uintptr_t stack_segment_base = 0xC0000000;
+#else
+      /* Cause tests to fail. */
+      uintptr_t stack_segment_base = 0;
+#endif
 
       VERBOSE_TRACE ("mf: stack estimated as %08lx-%08lx\n", 
 		     stack_top_guess, stack_segment_base);
@@ -72,6 +60,7 @@ __mf_heuristic_check (uintptr_t ptr, uin
 	  return 1;
 	}            
     }
+#endif
 
 
   /* The second heuristic is to scan the range of memory regions
Index: mf-hooks.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/mf-hooks.c,v
retrieving revision 1.1.2.35
diff -u -p -w -s -r1.1.2.35 mf-hooks.c
--- mf-hooks.c	23 May 2003 16:40:05 -0000	1.1.2.35
+++ mf-hooks.c	11 Jun 2003 18:00:58 -0000
@@ -77,9 +77,10 @@ XXX: libgcc license?
 
 #if PIC
 /* A special bootstrap variant. */
-static void *
+void *
 __mf_0fn_malloc (size_t c)
 {
+  /* fprintf (stderr, "0fn malloc c=%lu\n", c); */
   return NULL;
 }
 #endif
@@ -112,9 +113,23 @@ WRAPPER(void *, malloc, size_t c)
 
 #ifdef PIC
 /* A special bootstrap variant. */
-static void *
+void *
 __mf_0fn_calloc (size_t c, size_t n)
 {
+  enum foo { BS = 4096, NB=10 };
+  static char bufs[NB][BS];
+  static unsigned bufs_used[NB];
+  unsigned i;
+
+  /* fprintf (stderr, "0fn calloc c=%lu n=%lu\n", c, n); */
+  for (i=0; i<NB; i++)
+    {
+      if (! bufs_used[i] && (c*n) < BS)
+	{
+	  bufs_used[i] = 1;
+	  return & bufs[i][0];
+	}
+    }
   return NULL;
 }
 #endif
@@ -152,7 +167,7 @@ WRAPPER(void *, calloc, size_t c, size_t
 
 #if PIC
 /* A special bootstrap variant. */
-static void *
+void *
 __mf_0fn_realloc (void *buf, size_t c)
 {
   return NULL;
@@ -209,7 +224,7 @@ WRAPPER(void *, realloc, void *buf, size
 
 #if PIC
 /* A special bootstrap variant. */
-static void
+void
 __mf_0fn_free (void *buf)
 {
   return;
@@ -283,7 +298,7 @@ WRAPPER(void, free, void *buf)
 
 #if PIC
 /* A special bootstrap variant. */
-static void *
+void *
 __mf_0fn_mmap (void *start, size_t l, int prot, int f, int fd, off_t off)
 {
   return (void *) -1;
@@ -340,7 +355,7 @@ WRAPPER(void *, mmap, 
 
 #if PIC
 /* A special bootstrap variant. */
-static int
+int
 __mf_0fn_munmap (void *start, size_t length)
 {
   return -1;
@@ -972,7 +987,7 @@ __mf_pthread_spawner (void *arg)
 
 #if PIC
 /* A special bootstrap variant. */
-static int
+int
 __mf_0fn_pthread_create (pthread_t *thr, pthread_attr_t *attr, 
 			 void * (*start) (void *), void *arg)
 {
Index: mf-impl.h
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/mf-impl.h,v
retrieving revision 1.1.2.20
diff -u -p -w -s -r1.1.2.20 mf-impl.h
--- mf-impl.h	16 May 2003 19:56:55 -0000	1.1.2.20
+++ mf-impl.h	11 Jun 2003 18:00:58 -0000
@@ -280,12 +280,13 @@ ret __real_ ## fname (__VA_ARGS__)      
     __attribute__ (( alias  (#fname)  ));             \
 ret fname (__VA_ARGS__)
 #define DECLARE(ty, fname, ...)                       \
- typedef ty (*__mf_fn_ ## fname) (__VA_ARGS__)
+ typedef ty (*__mf_fn_ ## fname) (__VA_ARGS__);       \
+ extern ty __mf_0fn_ ## fname (__VA_ARGS__);
 #define CALL_REAL(fname, ...)                         \
-  ({ if (UNLIKELY(!__mf_dynamic[dyn_ ## fname].pointer))  \
-     __mf_resolve_single_dynamic (& __mf_dynamic[dyn_ ## fname]);  \
-  ((__mf_fn_ ## fname)(__mf_dynamic[dyn_ ## fname].pointer)) \
-                      (__VA_ARGS__);})
+  ({(__mf_state == starting) \
+     ? __mf_0fn_ ## fname (__VA_ARGS__) \
+    : (__mf_resolve_single_dynamic (& __mf_dynamic[dyn_ ## fname]), \
+       (((__mf_fn_ ## fname)(__mf_dynamic[dyn_ ## fname].pointer)) (__VA_ARGS__)));})
 #define CALL_BACKUP(fname, ...)                       \
   __mf_0fn_ ## fname(__VA_ARGS__)
 #define CALL_WRAP(fname, ...)                         \
Index: mf-runtime.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/mf-runtime.c,v
retrieving revision 1.1.2.38
diff -u -p -w -s -r1.1.2.38 mf-runtime.c
--- mf-runtime.c	23 May 2003 21:27:37 -0000	1.1.2.38
+++ mf-runtime.c	11 Jun 2003 18:00:59 -0000
@@ -85,7 +85,7 @@ unsigned char __mf_lc_shift = LOOKUP_CAC
 #define LOOKUP_CACHE_SIZE (__mf_lc_mask + 1)
 
 struct __mf_options __mf_opts;
-enum __mf_state __mf_state = inactive;
+enum __mf_state __mf_state = starting;
 
 #ifdef LIBMUDFLAPTH
 pthread_mutex_t __mf_biglock =
@@ -513,7 +513,7 @@ __mf_resolve_single_dynamic (struct __mf
   char *err;
 
   assert (e);
-  e->pointer = NULL;
+  if (e->pointer) return;
 
 #if HAVE_DLVSYM
   if (e->version != NULL && e->version[0] != '\0') /* non-null/empty */
@@ -568,11 +568,11 @@ struct __mf_dynamic_entry __mf_dynamic [
 
 /* ------------------------------------------------------------------------ */
 
+
 void __mf_init ()
 {
   char *ov = 0;
 
-  __mf_state = starting;
 #ifdef PIC
   __mf_resolve_dynamics ();
 #endif
@@ -605,23 +605,52 @@ void __mf_init ()
   /* Prevent access to *NULL. */
   __mf_register (MINPTR, 1, __MF_TYPE_NOACCESS, "NULL");
   __mf_lookup_cache[0].low = (uintptr_t) -1;
+}
+
+
+
+int
+__wrap_main (int argc, char* argv[])
+{
+  static int been_here = 0;
+  if (__mf_opts.heur_argv_environ && ! been_here)
+    {
+      extern char **environ;
+      unsigned i;
 
-  /* XXX: bad hack: assumes Linux process layout */
-  if (__mf_opts.heur_argv_environ)
+      been_here = 1;
+      __mf_register (argv, sizeof(char *)*(argc+1), __MF_TYPE_GUESS, "argv[]");
+      for (i=0; i<argc; i++)
     {
-      int foo = 0;
-      __mf_register (& foo,
-		      (size_t) 0xC0000000 - (size_t) (& foo),
-		      __MF_TYPE_GUESS,
-		      "argv/environ area");
-      /* XXX: separate heuristic? */
+	  unsigned j = strlen (argv[i]);
+	  __mf_register (argv[i], j+1, __MF_TYPE_GUESS, "argv element");
+	}
+
+      for (i=0; ; i++)
+	{
+	  char *e = environ[i];
+	  unsigned j;
+	  if (e == NULL) break;
+	  j = strlen (environ[i]);
+	  __mf_register (environ[i], j+1, __MF_TYPE_GUESS, "environ element");
+	}
+      __mf_register (environ, sizeof(char *)*(i+1), __MF_TYPE_GUESS, "environ[]");
+
+      /* XXX: separate heuristic flag? */
       __mf_register (& errno, sizeof (errno),
 		      __MF_TYPE_GUESS,
 		      "errno area");
     }
+
+#ifdef PIC
+  return main (argc, argv, environ);
+#else
+  return __real_main (argc, argv, environ);
+#endif
 }
 
 
+
 extern void __mf_fini () DTOR;
 void __mf_fini ()
 {
@@ -656,7 +685,7 @@ void __mfu_check (void *ptr, size_t sz, 
   if (UNLIKELY (__mf_opts.sigusr1_report))
     __mf_sigusr1_respond ();
 
-  TRACE ("mf: check ptr=%08lx b=%u size=%lu %s location=`%s'\n",
+  TRACE ("mf: check ptr=%p b=%u size=%lu %s location=`%s'\n",
 	 ptr, entry_idx, sz, (type == 0 ? "read" : "write"), location);
   
   switch (__mf_opts.mudflap_mode)
@@ -957,7 +986,7 @@ __mf_register (void *ptr, size_t sz, int
 void
 __mfu_register (void *ptr, size_t sz, int type, const char *name)
 {
-  TRACE ("mf: register ptr=%08lx size=%lu type=%x name='%s'\n", ptr, sz, 
+  TRACE ("mf: register ptr=%p size=%lu type=%x name='%s'\n", ptr, sz, 
 	type, name ? name : "");
 
   if (__mf_opts.collect_stats)
@@ -1017,7 +1046,7 @@ __mfu_register (void *ptr, size_t sz, in
 		&& ovr_obj->data.high == high)
 	      {
 		/* do nothing */
-		VERBOSE_TRACE ("mf: duplicate static reg %08lx-%08lx `%s'\n", 
+		VERBOSE_TRACE ("mf: duplicate static reg %p-%p `%s'\n", 
 			       low, high, 
 			       (ovr_obj->data.name ? ovr_obj->data.name : ""));
 		break;
@@ -1031,7 +1060,7 @@ __mfu_register (void *ptr, size_t sz, in
 		ovr_obj->data.high == high)
 	      {
 		/* do nothing */
-		VERBOSE_TRACE ("mf: duplicate guess reg %08lx-%08lx\n", low, high);
+		VERBOSE_TRACE ("mf: duplicate guess reg %p-%p\n", low, high);
 		break;
 	      }
 
@@ -1057,7 +1086,7 @@ __mfu_register (void *ptr, size_t sz, in
 						  num_overlapping_objs);
 		assert (num_ovr_objs == num_overlapping_objs);
 
-		VERBOSE_TRACE ("mf: splitting guess %08lx-%08lx, # overlaps: %u\n",
+		VERBOSE_TRACE ("mf: splitting guess %p-%p, # overlaps: %u\n",
 			       low, high, num_ovr_objs);
 
 		/* Add GUESS regions between the holes: before each
@@ -1156,7 +1185,7 @@ __mfu_unregister (void *ptr, size_t sz)
   if (UNLIKELY (__mf_opts.sigusr1_report))
   __mf_sigusr1_respond ();
 
-  TRACE ("mf: unregister ptr=%08lx size=%lu\n", ptr, sz);
+  TRACE ("mf: unregister ptr=%p size=%lu\n", ptr, sz);
 
   switch (__mf_opts.mudflap_mode)
     { 
@@ -1395,7 +1424,7 @@ __mf_tree_analyze (__mf_object_tree_t *o
 	  unsigned i;
 	  uintptr_t addr;
 
-	  VERBOSE_TRACE ("mf: analyze low=%08lx live=%u name=`%s'\n",
+	  VERBOSE_TRACE ("mf: analyze low=%p live=%u name=`%s'\n",
 			 obj->data.low, obj->data.liveness, obj->data.name);
 
 	  s->live_obj_count ++;
@@ -1471,7 +1500,7 @@ __mf_adapt_cache ()
   new_mask &= (LOOKUP_CACHE_SIZE_MAX - 1);
 
   VERBOSE_TRACE ("mf: adapt cache obj=%u/%u sizes=%lu/%.0f/%.0f => "
-		 "util=%u%% m=%08lx s=%u\n",
+		 "util=%u%% m=%p s=%u\n",
 		 s.obj_count, s.live_obj_count, s.total_size, s.total_weight, s.weighted_size,
 		 (unsigned)(cache_utilization*100.0), new_mask, new_shift);
 
@@ -1744,7 +1773,7 @@ __mf_describe_object (__mf_object_t *obj
   if (__mf_opts.abbreviate && obj->description_epoch == epoch)
     {
       fprintf (stderr,
-	       "mudflap object %08lx: name=`%s'\n",
+	       "mudflap object %p: name=`%s'\n",
 	       (uintptr_t) obj, (obj->name ? obj->name : ""));
       return;
     }
@@ -1752,9 +1781,9 @@ __mf_describe_object (__mf_object_t *obj
     obj->description_epoch = epoch;
 
   fprintf (stderr,
-	   "mudflap object %08lx: name=`%s'\n"
-	   "bounds=[%08lx,%08lx] size=%lu area=%s check=%ur/%uw liveness=%u%s\n"
-	   "alloc time=%lu.%06lu pc=%08lx\n",
+	   "mudflap object %p: name=`%s'\n"
+	   "bounds=[%p,%p] size=%lu area=%s check=%ur/%uw liveness=%u%s\n"
+	   "alloc time=%lu.%06lu pc=%p\n",
 	   (uintptr_t) obj, (obj->name ? obj->name : ""), 
 	   obj->low, obj->high, (obj->high - obj->low + 1),
 	   (obj->type == __MF_TYPE_NOACCESS ? "no-access" :
@@ -1779,7 +1808,7 @@ __mf_describe_object (__mf_object_t *obj
     {
       if (obj->deallocated_p)
 	{
-	  fprintf (stderr, "dealloc time=%lu.%06lu pc=%08lx\n",
+	  fprintf (stderr, "dealloc time=%lu.%06lu pc=%p\n",
 		   obj->dealloc_time.tv_sec, obj->dealloc_time.tv_usec, obj->dealloc_pc);
 
 	  if (__mf_opts.backtrace > 0)
@@ -1992,7 +2021,7 @@ __mf_backtrace (char ***symbols, void *g
     for (i = 0; i < remaining_size; i++)
       {
 	pointers[i] = chars;
-	sprintf (chars, "[0x%08lx]", pc_array [omitted_size + i]);
+	sprintf (chars, "[0x%p]", pc_array [omitted_size + i]);
 	chars = chars + perline;
       }
     *symbols = pointers;
@@ -2014,7 +2043,7 @@ __mf_violation (void *ptr, size_t sz, ui
   static unsigned violation_number;
   DECLARE(void, free, void *ptr);
 
-  TRACE ("mf: violation pc=%08lx location=%s type=%d ptr=%08lx size=%lu\n", pc, 
+  TRACE ("mf: violation pc=%p location=%s type=%d ptr=%p size=%lu\n", pc, 
 	 (location != NULL ? location : ""), type, ptr, sz);
 
   if (__mf_opts.collect_stats)
@@ -2036,7 +2065,7 @@ __mf_violation (void *ptr, size_t sz, ui
     fprintf (stderr,
 	     "*******\n"
 	     "mudflap violation %u (%s): time=%lu.%06lu "
-	     "ptr=%08lx size=%lu\npc=%08lx%s%s%s\n", 
+	     "ptr=%p size=%lu\npc=%p%s%s%s\n", 
 	     violation_number,
 	     ((type == __MF_VIOL_READ) ? "check/read" :
 	      (type == __MF_VIOL_WRITE) ? "check/write" :
@@ -2186,7 +2215,7 @@ __mf_watch_or_not (void *ptr, size_t sz,
   uintptr_t ptr_low = (uintptr_t) ptr;
   unsigned count = 0;
 
-  TRACE ("mf: %s ptr=%08lx size=%lu",
+  TRACE ("mf: %s ptr=%p size=%lu",
 	 (flag ? "watch" : "unwatch"), ptr, sz);
   
   switch (__mf_opts.mudflap_mode)
@@ -2218,7 +2247,7 @@ __mf_watch_or_not (void *ptr, size_t sz,
 	  {
 	    __mf_object_t *obj = & (all_ovr_objs[n]->data);
 
-	    VERBOSE_TRACE (" [%08lx]", (uintptr_t) obj);
+	    VERBOSE_TRACE (" [%p]", (uintptr_t) obj);
 	    if (obj->watching_p != flag)
 	      {
 		obj->watching_p = flag;
Index: testsuite/libmudflap.c/pass38-frag.c
===================================================================
RCS file: testsuite/libmudflap.c/pass38-frag.c
diff -N testsuite/libmudflap.c/pass38-frag.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/libmudflap.c/pass38-frag.c	11 Jun 2003 18:00:59 -0000
@@ -0,0 +1,9 @@
+/* Test an odd construct for compilability.  */
+static void *fwd;
+void *bwd = &fwd;
+static void *fwd = &bwd;
+
+int main ()
+{
+  return 0;
+}
Index: testsuite/libmudflap.cth/pass37-frag.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/testsuite/libmudflap.cth/Attic/pass37-frag.c,v
retrieving revision 1.1.2.1
diff -u -p -w -s -r1.1.2.1 pass37-frag.c
--- testsuite/libmudflap.cth/pass37-frag.c	16 May 2003 19:56:56 -0000	1.1.2.1
+++ testsuite/libmudflap.cth/pass37-frag.c	11 Jun 2003 18:00:59 -0000
@@ -6,12 +6,12 @@
 static void *
 func (void *p)
 {
-  int thr = (int) p;
+  int *counter = (int *) p;
   unsigned i;
   
   for (i=0; i<100; i++)
     {
-      /* fprintf (stderr, "thread %d iteration %u REG\n", thr, i); */
+      (*counter) ++;
       {
 	int array[17];
 	unsigned x = i % (sizeof(array)/sizeof(array[0]));
@@ -20,7 +20,6 @@ func (void *p)
 	   libmudflap. */
 	array[x] = i;
       }
-      /* fprintf (stderr, "thread %d iteration %u UNREG/YIELD\n", thr, i); */
       sched_yield (); /* sleep (1); */
     }
 
@@ -32,19 +31,25 @@ int main ()
 {
   int rc;
   unsigned i;
-  pthread_t	threads[10];
+  enum foo { NT=10 };
+  pthread_t threads[NT];
+  int counts[NT];
 
-  for (i=0; i<sizeof(threads)/sizeof(threads[0]); i++)
+
+  for (i=0; i<NT; i++)
     {
-      rc = pthread_create (& threads[i], NULL, func, (void *) i);
+      counts[i] = 0;
+      rc = pthread_create (& threads[i], NULL, func, (void *) & counts[i]);
       if (rc) abort();
     }
 
-  for (i=0; i<sizeof(threads)/sizeof(threads[0]); i++)
+  for (i=0; i<NT; i++)
     {
       rc = pthread_join (threads[i], NULL);
       if (rc) abort();      
+      printf ("%d%s", counts[i], (i==NT-1) ? "\n" : " ");
     }
 
   return 0;
 }
+/* { dg-output "100 100 100 100 100 100 100 100 100 100" } */




Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.324.2.32
diff -u -w -p -s -r1.324.2.32 gcc.c
--- gcc.c	3 Jun 2003 16:50:43 -0000	1.324.2.32
+++ gcc.c	11 Jun 2003 17:55:58 -0000
@@ -603,14 +603,13 @@ proper position among the other output f
 
 /* mudflap specs */
 #ifndef MFWRAP_SPEC
-/* XXX: valid only if linking with static libmudflap.a */
 /* XXX: valid only for GNU ld */
 /* XXX: should exactly match hooks provided by libmudflap.a */
 #define MFWRAP_SPEC " %{static: %{fmudflap|fmudflapth: \
  --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc\
  --wrap=mmap --wrap=munmap --wrap=alloca\
 } %{fmudflapth: --wrap=pthread_create\
-}}"
+}} %{fmudflap|fmudflapth: --wrap=main}"
 #endif
 #ifndef MFLIB_SPEC
 #define MFLIB_SPEC " %{fmudflap: -export-dynamic -lmudflap %{static:%(link_gcc_c_sequence) -lmudflap}} %{fmudflapth: -export-dynamic -lmudflapth -lpthread %{static:%(link_gcc_c_sequence) -lmudflapth}} "
Index: tree-mudflap.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-mudflap.c,v
retrieving revision 1.1.2.44
diff -u -w -p -s -r1.1.2.44 tree-mudflap.c
--- tree-mudflap.c	5 Jun 2003 17:29:39 -0000	1.1.2.44
+++ tree-mudflap.c	11 Jun 2003 17:55:59 -0000
@@ -1276,6 +1276,8 @@ mudflap_enqueue_decl (obj, label)
       tree object_size;
       tree call_stmt;
 
+      mf_mark (obj);
+
       object_size = size_in_bytes (TREE_TYPE (obj));
 
       dump_file = dump_begin (TDI_mudflap, &dump_flags);


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