This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.22-2-g3fad53e


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  3fad53ec87945e61015913f2d09271573504a1e9 (commit)
      from  1b15ff4810748abee11b949e6faa115f3f2d20f4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3fad53ec87945e61015913f2d09271573504a1e9

commit 3fad53ec87945e61015913f2d09271573504a1e9
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Wed Jul 29 22:53:28 2015 -0400

    nptl: fix set-but-unused warning w/_STACK_GROWS_UP
    
    On arches that set _STACK_GROWS_UP, the stacktop variable is declared
    and set, but never actually used.  Refactor the code a bit so that the
    variable is only declared/set under _STACK_GROWS_DOWN settings.

diff --git a/ChangeLog b/ChangeLog
index 4bbad33..37a825e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-05  Mike Frysinger  <vapier@gentoo.org>
+
+	* nptl/allocatestack.c (allocate_stack): Move stacktop decl down to
+	bottom and under _STACK_GROWS_DOWN.  Move the stacktop assignment
+	in there too.
+
 2015-08-05  Carlos O'Donell  <carlos@systemhalted.org>
 
 	* version.h (RELEASE): Set to "development".
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index c56a4df..753da61 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -353,7 +353,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
   struct pthread *pd;
   size_t size;
   size_t pagesize_m1 = __getpagesize () - 1;
-  void *stacktop;
 
   assert (powerof2 (pagesize_m1 + 1));
   assert (TCB_ALIGNMENT >= STACK_ALIGN);
@@ -717,19 +716,23 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
   /* We place the thread descriptor at the end of the stack.  */
   *pdp = pd;
 
-#if TLS_TCB_AT_TP
+#if _STACK_GROWS_DOWN
+  void *stacktop;
+
+# if TLS_TCB_AT_TP
   /* The stack begins before the TCB and the static TLS block.  */
   stacktop = ((char *) (pd + 1) - __static_tls_size);
-#elif TLS_DTV_AT_TP
+# elif TLS_DTV_AT_TP
   stacktop = (char *) (pd - 1);
-#endif
+# endif
 
-#ifdef NEED_SEPARATE_REGISTER_STACK
+# ifdef NEED_SEPARATE_REGISTER_STACK
   *stack = pd->stackblock;
   *stacksize = stacktop - *stack;
-#elif _STACK_GROWS_DOWN
+# else
   *stack = stacktop;
-#elif _STACK_GROWS_UP
+# endif
+#else
   *stack = pd->stackblock;
   assert (*stack > 0);
 #endif

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog            |    6 ++++++
 nptl/allocatestack.c |   17 ++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]