Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 493648 | Differences between
and this patch

Collapse All | Expand All

(-)newlib-2.0.0.orig/newlib/libc/string/memmove.c (+17 lines)
Lines 40-45 Link Here
40
#include <stddef.h>
40
#include <stddef.h>
41
#include <limits.h>
41
#include <limits.h>
42
42
43
/* hack because currently I don't want to fiddle with autoconf */
44
#define HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
45
46
/*
47
   Taken from glibc:
48
   Add the compiler optimization to inhibit loop transformation to library
49
   calls.  This is used to avoid recursive calls in memset and memmove
50
   default implementations.
51
*/
52
#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
53
# define inhibit_loop_to_libcall \
54
  __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
55
#else
56
# define inhibit_loop_to_libcall
57
#endif
58
43
/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
59
/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
44
#define UNALIGNED(X, Y) \
60
#define UNALIGNED(X, Y) \
45
  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
61
  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
Lines 55-60 Link Here
55
71
56
/*SUPPRESS 20*/
72
/*SUPPRESS 20*/
57
_PTR
73
_PTR
74
inhibit_loop_to_libcall
58
_DEFUN (memmove, (dst_void, src_void, length),
75
_DEFUN (memmove, (dst_void, src_void, length),
59
	_PTR dst_void _AND
76
	_PTR dst_void _AND
60
	_CONST _PTR src_void _AND
77
	_CONST _PTR src_void _AND
(-)newlib-2.0.0.orig/newlib/libc/string/memset.c (+17 lines)
Lines 35-45 Link Here
35
35
36
#include <string.h>
36
#include <string.h>
37
37
38
/* hack because currently I don't want to fiddle with autoconf */
39
#define HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
40
41
/*
42
   Taken from glibc:
43
   Add the compiler optimization to inhibit loop transformation to library
44
   calls.  This is used to avoid recursive calls in memset and memmove
45
   default implementations.
46
*/
47
#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
48
# define inhibit_loop_to_libcall \
49
  __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
50
#else
51
# define inhibit_loop_to_libcall
52
#endif
53
38
#define LBLOCKSIZE (sizeof(long))
54
#define LBLOCKSIZE (sizeof(long))
39
#define UNALIGNED(X)   ((long)X & (LBLOCKSIZE - 1))
55
#define UNALIGNED(X)   ((long)X & (LBLOCKSIZE - 1))
40
#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE)
56
#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE)
41
57
42
_PTR
58
_PTR
59
inhibit_loop_to_libcall
43
_DEFUN (memset, (m, c, n),
60
_DEFUN (memset, (m, c, n),
44
	_PTR m _AND
61
	_PTR m _AND
45
	int c _AND
62
	int c _AND

Return to bug 493648