+2008-05-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ * gthr-single.h: Add in required interface elements as per gthr.h.
+ Add stub types for __gthread_key_t, __gthread_once_t. Add defines
+ for __GTHREAD_ONCE_INIT, __GTHREAD_RECURSIVE_MUTEX_INIT.
+ Generalize UNUSED macro.
+ (__gthread_once): Add.
+ (__gthread_key_create): Add.
+ (__gthread_key_delete): Add.
+ (__gthread_getspecific): Add.
+ (__gthread_setspecific): Add.
+
2008-05-05 Andrew Pinski <Andrew.Pinski@playstation.sony.com>
- * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): If we have the
- same size types for the indirect reference on the rhs, then create a VCE.
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): If we have
+ the same size types for the indirect reference on the rhs, then
+ create a VCE.
2008-05-05 Uros Bizjak <ubizjak@gmail.com>
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1999, 2000, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2004, 2008 Free Software Foundation, Inc.
This file is part of GCC.
/* Just provide compatibility for mutex handling. */
+typedef int __gthread_key_t;
+typedef int __gthread_once_t;
typedef int __gthread_mutex_t;
typedef int __gthread_recursive_mutex_t;
+#define __GTHREAD_ONCE_INIT 0
#define __GTHREAD_MUTEX_INIT 0
+#define __GTHREAD_RECURSIVE_MUTEX_INIT 0
-#ifdef __cplusplus
-#define UNUSED(x)
-#else
-#define UNUSED(x) x __attribute__((unused))
-#endif
+#define UNUSED __attribute__((unused))
#ifdef _LIBOBJC
/* Create a new thread of execution. */
static inline objc_thread_t
-__gthread_objc_thread_detach (void (* func)(void *), void * UNUSED(arg))
+__gthread_objc_thread_detach (void (* func)(void *), void * arg UNUSED)
{
/* No thread support available */
return NULL;
/* Set the current thread's priority. */
static inline int
-__gthread_objc_thread_set_priority (int UNUSED(priority))
+__gthread_objc_thread_set_priority (int priority UNUSED)
{
/* No thread support available */
return -1;
/* Allocate a mutex. */
static inline int
-__gthread_objc_mutex_allocate (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_allocate (objc_mutex_t mutex UNUSED)
{
return 0;
}
/* Deallocate a mutex. */
static inline int
-__gthread_objc_mutex_deallocate (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex UNUSED)
{
return 0;
}
/* Grab a lock on a mutex. */
static inline int
-__gthread_objc_mutex_lock (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_lock (objc_mutex_t mutex UNUSED)
{
/* There can only be one thread, so we always get the lock */
return 0;
/* Try to grab a lock on a mutex. */
static inline int
-__gthread_objc_mutex_trylock (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_trylock (objc_mutex_t mutex UNUSED)
{
/* There can only be one thread, so we always get the lock */
return 0;
/* Unlock the mutex */
static inline int
-__gthread_objc_mutex_unlock (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_unlock (objc_mutex_t mutex UNUSED)
{
return 0;
}
/* Allocate a condition. */
static inline int
-__gthread_objc_condition_allocate (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_allocate (objc_condition_t condition UNUSED)
{
return 0;
}
/* Deallocate a condition. */
static inline int
-__gthread_objc_condition_deallocate (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_deallocate (objc_condition_t condition UNUSED)
{
return 0;
}
/* Wait on the condition */
static inline int
-__gthread_objc_condition_wait (objc_condition_t UNUSED(condition),
- objc_mutex_t UNUSED(mutex))
+__gthread_objc_condition_wait (objc_condition_t condition UNUSED,
+ objc_mutex_t mutex UNUSED)
{
return 0;
}
/* Wake up all threads waiting on this condition. */
static inline int
-__gthread_objc_condition_broadcast (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_broadcast (objc_condition_t condition UNUSED)
{
return 0;
}
/* Wake up one thread waiting on this condition. */
static inline int
-__gthread_objc_condition_signal (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_signal (objc_condition_t condition UNUSED)
{
return 0;
}
return 0;
}
+static inline int
+__gthread_once (__gthread_once_t *once UNUSED, void (*func) () UNUSED)
+{
+ return 0;
+}
+
+static inline int UNUSED
+__gthread_key_create (__gthread_key_t *key UNUSED, void (*func) (void *) UNUSED)
+{
+ return 0;
+}
+
+static int UNUSED
+__gthread_key_delete (__gthread_key_t key UNUSED)
+{
+ return 0;
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t key UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t key UNUSED, const void *v UNUSED)
+{
+ return 0;
+}
+
static inline int
-__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_destroy (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}
static inline int
-__gthread_mutex_lock (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_lock (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}
static inline int
-__gthread_mutex_trylock (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_trylock (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}
static inline int
-__gthread_mutex_unlock (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_unlock (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}