diff options
author | sje <sje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-21 17:57:01 +0000 |
---|---|---|
committer | sje <sje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-21 17:57:01 +0000 |
commit | fe87ce9b41894a42601a55957026ecaec1ec460b (patch) | |
tree | 16ba62c14bd05fa0e4fd37e596e2a99d95e7f40b | |
parent | f64e6a695b544f9333f838411fb495733a995b76 (diff) | |
download | gcc-fe87ce9b41894a42601a55957026ecaec1ec460b.tar.gz |
PR libgomp/25877
* configure.ac: Remove check for alloca.h.
* configure: Regenerate.
* config.h.in: Regenerate.
* libgomp.h: define gomp_alloca to be __builtin_alloca.
* team.c: Remove use of alloca.h.
Call gomp_alloca instead of alloca.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110068 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libgomp/ChangeLog | 10 | ||||
-rw-r--r-- | libgomp/config.h.in | 3 | ||||
-rwxr-xr-x | libgomp/configure | 3 | ||||
-rw-r--r-- | libgomp/configure.ac | 2 | ||||
-rw-r--r-- | libgomp/libgomp.h | 4 | ||||
-rw-r--r-- | libgomp/team.c | 8 |
6 files changed, 18 insertions, 12 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 0b151aa0b35..e33066aa777 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,13 @@ +2006-01-21 Steve Ellcey <sje@cup.hp.com> + + PR libgomp/25877 + * configure.ac: Remove check for alloca.h. + * configure: Regenerate. + * config.h.in: Regenerate. + * libgomp.h: define gomp_alloca to be __builtin_alloca. + * team.c: Remove use of alloca.h. + Call gomp_alloca instead of alloca. + 2006-01-20 Steve Ellcey <sje@cup.hp.com> PR libgomp/25877 diff --git a/libgomp/config.h.in b/libgomp/config.h.in index 9d2fa77b6e7..a24e14867c7 100644 --- a/libgomp/config.h.in +++ b/libgomp/config.h.in @@ -1,8 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* Define to 1 if you have the <alloca.h> header file. */ -#undef HAVE_ALLOCA_H - /* Define to 1 if the target supports __attribute__((alias(...))). */ #undef HAVE_ATTRIBUTE_ALIAS diff --git a/libgomp/configure b/libgomp/configure index 83ded9e9a3a..4824adc51e9 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -5317,8 +5317,7 @@ done - -for ac_header in alloca.h unistd.h semaphore.h sys/time.h +for ac_header in unistd.h semaphore.h sys/time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then diff --git a/libgomp/configure.ac b/libgomp/configure.ac index 90e115bdaf9..854514a27f4 100644 --- a/libgomp/configure.ac +++ b/libgomp/configure.ac @@ -136,7 +136,7 @@ AC_SUBST(libtool_VERSION) # Check header files. AC_STDC_HEADERS AC_HEADER_TIME -AC_CHECK_HEADERS(alloca.h unistd.h semaphore.h sys/time.h) +AC_CHECK_HEADERS(unistd.h semaphore.h sys/time.h) AC_CHECK_HEADER([pthread.h],[], [AC_MSG_ERROR([Pthreads are required to build libgomp])]) diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h index 771fc1c4792..dd1e494bfd0 100644 --- a/libgomp/libgomp.h +++ b/libgomp/libgomp.h @@ -250,6 +250,10 @@ extern void *gomp_malloc (size_t) __attribute__((malloc)); extern void *gomp_malloc_cleared (size_t) __attribute__((malloc)); extern void *gomp_realloc (void *, size_t); +/* Avoid conflicting prototypes of alloca() in system headers by using + GCC's builtin alloca(). */ +#define gomp_alloca(x) __builtin_alloca(x) + /* error.c */ extern void gomp_error (const char *, ...) diff --git a/libgomp/team.c b/libgomp/team.c index c99413502d5..a4020fc37c4 100644 --- a/libgomp/team.c +++ b/libgomp/team.c @@ -32,11 +32,6 @@ #include <stdlib.h> #include <string.h> -#ifdef HAVE_ALLOCA_H -# include <alloca.h> -#endif - - /* This array manages threads spawned from the top level, which will return to the idle loop once the current PARALLEL construct ends. */ static struct gomp_thread **gomp_threads; @@ -270,7 +265,8 @@ gomp_team_start (void (*fn) (void *), void *data, unsigned nthreads, } } - start_data = alloca (sizeof (struct gomp_thread_start_data) * (nthreads-i)); + start_data = gomp_alloca (sizeof (struct gomp_thread_start_data) + * (nthreads-i)); /* Launch new threads. */ for (; i < nthreads; ++i, ++start_data) |