diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-17 16:19:56 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-17 16:19:56 +0000 |
commit | 6014aff2a580b7e68ce78a678966738999494f2b (patch) | |
tree | 4aba793faea5f0c0e6b31efb9fae3b9b7af9fd00 /libgcc | |
parent | a8d15480cc00440e438e55a595e4da03b12aee7d (diff) | |
download | gcc-6014aff2a580b7e68ce78a678966738999494f2b.tar.gz |
Avoid dependence on libc headers in nvptx realloc.
* config/nvptx/realloc.c: Include <stddef.h> instead of <stdlib.h>
and <string.h>.
(__nvptx_realloc): Call __builtin_memcpy instead of memcpy.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220764 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 6 | ||||
-rw-r--r-- | libgcc/config/nvptx/realloc.c | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 2c9b6e86d08..0bff7ef3b06 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-17 Joseph Myers <joseph@codesourcery.com> + + * config/nvptx/realloc.c: Include <stddef.h> instead of <stdlib.h> + and <string.h>. + (__nvptx_realloc): Call __builtin_memcpy instead of memcpy. + 2015-02-10 Rainer Emrich <rainer@emrich-ebersheim.de> PR gcov-profile/61889 diff --git a/libgcc/config/nvptx/realloc.c b/libgcc/config/nvptx/realloc.c index 5b4a9a41698..136f0101f6c 100644 --- a/libgcc/config/nvptx/realloc.c +++ b/libgcc/config/nvptx/realloc.c @@ -21,8 +21,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ -#include <stdlib.h> -#include <string.h> +#include <stddef.h> #include "nvptx-malloc.h" void * @@ -44,7 +43,7 @@ __nvptx_realloc (void *ptr, size_t newsz) oldsz = *sp; } if (oldsz != 0) - memcpy (newptr, ptr, oldsz > newsz ? newsz : oldsz); + __builtin_memcpy (newptr, ptr, oldsz > newsz ? newsz : oldsz); __nvptx_free (ptr); return newptr; |