public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: libc-ports@sourceware.org
Subject: Fix MIPS32 frame-pointer forcing for more recent GCC
Date: Thu, 14 Jun 2012 15:21:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1206141519020.24877@digraph.polyomino.org.uk> (raw)

The alloca call in FORCE_FRAME_POINTER in 
sysdeps/unix/sysv/linux/mips/mips32/sysdep.h is optimized away by GCC 4.7, 
resulting in failures of nptl/tst-cancel4, tst-cancel5, tst-cancelx4, 
tst-cancelx5.  I've applied this patch that fixes those failures by 
assigning the result of alloca to a volatile variable, so preventing it 
from being optimized away.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 853f286..9469b5c 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,9 @@
+2012-06-14  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+	(FORCE_FRAME_POINTER): Assign result of alloca to a volatile
+	variable.
+
 2012-06-01  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/mips/mips64/n32/s_fma.c: New file.
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index e51f329..8c024b0 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -194,8 +194,9 @@
 /* We need to use a frame pointer for the functions in which we
    adjust $sp around the syscall, or debug information and unwind
    information will be $sp relative and thus wrong during the syscall.  As
-   of GCC 3.4.3, this is sufficient.  */
-#define FORCE_FRAME_POINTER alloca (4)
+   of GCC 4.7, this is sufficient.  */
+#define FORCE_FRAME_POINTER						\
+  void *volatile __fp_force __attribute__ ((unused)) = alloca (4)
 
 #define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5)\
 ({									\

-- 
Joseph S. Myers
joseph@codesourcery.com

                 reply	other threads:[~2012-06-14 15:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1206141519020.24877@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=libc-ports@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).