c6d234
commit e782a927c24430100bf2008c96cd421a70285a7e
c6d234
Author: Joseph Myers <joseph@codesourcery.com>
c6d234
Date:   Fri Feb 1 06:35:29 2013 +0000
c6d234
c6d234
    Remove BOUNDED_N and BOUNDED_1.
c6d234
c6d234
Conflicts:
c6d234
	sysdeps/sparc/backtrace.c
c6d234
c6d234
The changes to that file have been applied to
c6d234
sysdeps/sparc/sparc64/backtrace.c instead.
c6d234
c6d234
diff --git a/debug/backtrace.c b/debug/backtrace.c
c6d234
index a3fd81c32d176089..d0785329a2514e20 100644
c6d234
--- a/debug/backtrace.c
c6d234
+++ b/debug/backtrace.c
c6d234
@@ -21,7 +21,6 @@
c6d234
 #include <signal.h>
c6d234
 #include <frame.h>
c6d234
 #include <sigcontextinfo.h>
c6d234
-#include <bp-checks.h>
c6d234
 #include <ldsodefs.h>
c6d234
 
c6d234
 /* This implementation assumes a stack layout that matches the defaults
c6d234
@@ -50,7 +49,7 @@
c6d234
 /* By default assume the `next' pointer in struct layout points to the
c6d234
    next struct layout.  */
c6d234
 #ifndef ADVANCE_STACK_FRAME
c6d234
-# define ADVANCE_STACK_FRAME(next) BOUNDED_1 ((struct layout *) (next))
c6d234
+# define ADVANCE_STACK_FRAME(next) ((struct layout *) (next))
c6d234
 #endif
c6d234
 
c6d234
 /* By default, the frame pointer is just what we get from gcc.  */
c6d234
@@ -72,7 +71,7 @@ __backtrace (array, size)
c6d234
   top_stack = CURRENT_STACK_FRAME;
c6d234
 
c6d234
   /* We skip the call to this function, it makes no sense to record it.  */
c6d234
-  current = BOUNDED_1 ((struct layout *) top_frame);
c6d234
+  current = ((struct layout *) top_frame);
c6d234
   while (cnt < size)
c6d234
     {
c6d234
       if ((void *) current INNER_THAN top_stack
c6d234
diff --git a/sysdeps/generic/bp-checks.h b/sysdeps/generic/bp-checks.h
c6d234
index d43e299d4dc06b6b..f2610786aed0cc85 100644
c6d234
--- a/sysdeps/generic/bp-checks.h
c6d234
+++ b/sysdeps/generic/bp-checks.h
c6d234
@@ -66,13 +66,6 @@ extern void *__unbounded __ubp_memchr (const void *__unbounded, int, unsigned);
c6d234
 /* Same as CHECK_STRING, but tolerate ARG == NULL.  */
c6d234
 # define CHECK_STRING_NULL_OK(ARG) _CHECK_STRING ((ARG), __ptrvalue (ARG))
c6d234
 
c6d234
-/* Return a bounded pointer with value PTR that satisfies CHECK_N (PTR, N).  */
c6d234
-# define BOUNDED_N(PTR, N) 				\
c6d234
-  ({ __typeof (PTR) __bounded _p_;			\
c6d234
-     __ptrvalue _p_ = __ptrlow _p_ = __ptrvalue (PTR);	\
c6d234
-     __ptrhigh _p_ = __ptrvalue _p_ + (N);		\
c6d234
-     _p_; })
c6d234
-
c6d234
 #else /* !__BOUNDED_POINTERS__ */
c6d234
 
c6d234
 /* Do nothing if not compiling with -fbounded-pointers.  */
c6d234
@@ -85,10 +78,7 @@ extern void *__unbounded __ubp_memchr (const void *__unbounded, int, unsigned);
c6d234
 # define CHECK_N(ARG, N) (ARG)
c6d234
 # define CHECK_N_NULL_OK(ARG, N) (ARG)
c6d234
 # define CHECK_STRING(ARG) (ARG)
c6d234
-# define BOUNDED_N(PTR, N) (PTR)
c6d234
 
c6d234
 #endif /* !__BOUNDED_POINTERS__ */
c6d234
 
c6d234
-#define BOUNDED_1(PTR) BOUNDED_N (PTR, 1)
c6d234
-
c6d234
 #endif /* _bp_checks_h_ */
c6d234
diff --git a/sysdeps/powerpc/powerpc32/backtrace.c b/sysdeps/powerpc/powerpc32/backtrace.c
c6d234
index 942951f2bc0ce45d..0e2e5c296876444e 100644
c6d234
--- a/sysdeps/powerpc/powerpc32/backtrace.c
c6d234
+++ b/sysdeps/powerpc/powerpc32/backtrace.c
c6d234
@@ -18,7 +18,6 @@
c6d234
 
c6d234
 #include <execinfo.h>
c6d234
 #include <stddef.h>
c6d234
-#include <bp-checks.h>
c6d234
 
c6d234
 /* This is the stack layout we see with every stack frame.
c6d234
    Note that every routine is required by the ABI to lay out the stack
c6d234
@@ -47,11 +46,10 @@ __backtrace (void **array, int size)
c6d234
 
c6d234
   /* Get the address on top-of-stack.  */
c6d234
   asm volatile ("lwz %0,0(1)" : "=r"(current));
c6d234
-  current = BOUNDED_1 (current);
c6d234
 
c6d234
   for (				count = 0;
c6d234
        current != NULL && 	count < size;
c6d234
-       current = BOUNDED_1 (current->next), count++)
c6d234
+       current = current->next, count++)
c6d234
     array[count] = current->return_address;
c6d234
 
c6d234
   /* It's possible the second-last stack frame can't return
c6d234
diff --git a/sysdeps/powerpc/powerpc64/backtrace.c b/sysdeps/powerpc/powerpc64/backtrace.c
c6d234
index 89957a5f4e1efb95..08e535585ef2a104 100644
c6d234
--- a/sysdeps/powerpc/powerpc64/backtrace.c
c6d234
+++ b/sysdeps/powerpc/powerpc64/backtrace.c
c6d234
@@ -18,7 +18,6 @@
c6d234
 
c6d234
 #include <execinfo.h>
c6d234
 #include <stddef.h>
c6d234
-#include <bp-checks.h>
c6d234
 
c6d234
 /* This is the stack layout we see with every stack frame.
c6d234
    Note that every routine is required by the ABI to lay out the stack
c6d234
@@ -50,11 +49,10 @@ __backtrace (void **array, int size)
c6d234
 
c6d234
   /* Get the address on top-of-stack.  */
c6d234
   asm volatile ("ld %0,0(1)" : "=r"(current));
c6d234
-  current = BOUNDED_1 (current);
c6d234
 
c6d234
   for (				count = 0;
c6d234
        current != NULL && 	count < size;
c6d234
-       current = BOUNDED_1 (current->next), count++)
c6d234
+       current = current->next, count++)
c6d234
     array[count] = current->return_address;
c6d234
 
c6d234
   /* It's possible the second-last stack frame can't return
c6d234
diff --git a/sysdeps/sparc/sparc64/backtrace.c b/sysdeps/sparc/sparc64/backtrace.c
c6d234
index e9a72a69a0c64d75..d5a1ebec000ce91e 100644
c6d234
--- a/sysdeps/sparc/sparc64/backtrace.c
c6d234
+++ b/sysdeps/sparc/sparc64/backtrace.c
c6d234
@@ -19,7 +19,6 @@
c6d234
 
c6d234
 #include <execinfo.h>
c6d234
 #include <stddef.h>
c6d234
-#include <bp-checks.h>
c6d234
 #include <sysdep.h>
c6d234
 
c6d234
 struct layout
c6d234
@@ -40,7 +39,6 @@ __backtrace (void **array, int size)
c6d234
   asm volatile ("flushw");
c6d234
   asm volatile ("mov %%fp, %0" : "=r"(fp));
c6d234
   current = (struct layout *__unbounded) (fp + STACK_BIAS);
c6d234
-  current = BOUNDED_1 (current);
c6d234
 
c6d234
   for (count = 0; count < size; count++)
c6d234
     {
c6d234
@@ -48,7 +46,6 @@ __backtrace (void **array, int size)
c6d234
       if (!current->next)
c6d234
 	break;
c6d234
       current = (struct layout *__unbounded) (current->next + STACK_BIAS);
c6d234
-      current = BOUNDED_1 (current);
c6d234
     }
c6d234
 
c6d234
   return count;
c6d234
diff --git a/sysdeps/unix/sysv/linux/shmat.c b/sysdeps/unix/sysv/linux/shmat.c
c6d234
index d01bb1bdb779fb0d..21417f4ced70e778 100644
c6d234
--- a/sysdeps/unix/sysv/linux/shmat.c
c6d234
+++ b/sysdeps/unix/sysv/linux/shmat.c
c6d234
@@ -23,7 +23,6 @@
c6d234
 #include <sysdep.h>
c6d234
 #include <unistd.h>
c6d234
 #include <sys/syscall.h>
c6d234
-#include <bp-checks.h>
c6d234
 
c6d234
 /* Attach the shared memory segment associated with SHMID to the data
c6d234
    segment of the calling process.  SHMADDR and SHMFLG determine how
c6d234
@@ -58,5 +57,5 @@ shmat (shmid, shmaddr, shmflg)
c6d234
       return (void *) -1l;
c6d234
     }
c6d234
 
c6d234
-  return BOUNDED_N (raddr, length);
c6d234
+  return raddr;
c6d234
 }