Do not clobber sp in _hurd_stack_setup

Message ID alpine.DEB.2.21.1812131808310.2735@digraph.polyomino.org.uk
State Committed
Headers

Commit Message

Joseph Myers Dec. 13, 2018, 6:09 p.m. UTC
  GCC mainline now gives errors for an asm that clobbers the stack
pointer.  According to
<https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00932.html> GCC
previously ignored such a clobber; thus, this patch removes it from
_hurd_stack_setup.

Tested with build-many-glibcs.py for i686-gnu.

2018-12-13  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup): Do not
	clobber sp.
  

Comments

Samuel Thibault Dec. 13, 2018, 10:35 p.m. UTC | #1
Joseph Myers, le jeu. 13 déc. 2018 18:09:21 +0000, a ecrit:
> GCC mainline now gives errors for an asm that clobbers the stack
> pointer.  According to
> <https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00932.html> GCC
> previously ignored such a clobber; thus, this patch removes it from
> _hurd_stack_setup.

Since the code does not return there is no use for a clobber anyway :)

Please commit, thanks!

> Tested with build-many-glibcs.py for i686-gnu.
> 
> 2018-12-13  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup): Do not
> 	clobber sp.
> 
> diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
> index f8ad2ceb8e..e3d5797266 100644
> --- a/sysdeps/mach/hurd/i386/init-first.c
> +++ b/sysdeps/mach/hurd/i386/init-first.c
> @@ -361,7 +361,7 @@ _hurd_stack_setup (void)
>        *--data = caller;
>        asm volatile ("movl %0, %%esp\n" /* Switch to new outermost stack.  */
>  		    "movl $0, %%ebp\n" /* Clear outermost frame pointer.  */
> -		    "jmp *%1" : : "r" (data), "r" (&doinit1) : "sp");
> +		    "jmp *%1" : : "r" (data), "r" (&doinit1));
>        /* NOTREACHED */
>      }
>  
> 
> -- 
> Joseph S. Myers
> joseph@codesourcery.com
>
  

Patch

diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index f8ad2ceb8e..e3d5797266 100644
--- a/sysdeps/mach/hurd/i386/init-first.c
+++ b/sysdeps/mach/hurd/i386/init-first.c
@@ -361,7 +361,7 @@  _hurd_stack_setup (void)
       *--data = caller;
       asm volatile ("movl %0, %%esp\n" /* Switch to new outermost stack.  */
 		    "movl $0, %%ebp\n" /* Clear outermost frame pointer.  */
-		    "jmp *%1" : : "r" (data), "r" (&doinit1) : "sp");
+		    "jmp *%1" : : "r" (data), "r" (&doinit1));
       /* NOTREACHED */
     }