public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Jiangning Liu" <jiangning.liu@arm.com>
To: <gcc-patches@gcc.gnu.org>
Subject: [PATCH, ARM] Fix stack red zone bug (PR38644)
Date: Wed, 02 Nov 2011 03:23:00 -0000	[thread overview]
Message-ID: <000e01cc9907$01ce9b80$056bd280$@liu@arm.com> (raw)

Hi,

This patch is to fix PR38644 in ARM back-end. OK for trunk?

For every detail, please refer to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38644.

ChangeLog:

2011-11-2  Jiangning Liu  <jiangning.liu@arm.com>

        PR rtl-optimization/38644
        * config/arm/arm.c (thumb1_expand_epilogue): Add memory barrier
        for epilogue having stack adjustment.

ChangeLog of testsuite:

2011-11-2  Jiangning Liu  <jiangning.liu@arm.com>

        PR rtl-optimization/38644
        * gcc.target/arm/stack-red-zone.c: New.

Thanks,
-Jiangning

Patch:

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index f1ada6f..1f6fc26
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -22215,6 +22215,8 @@ thumb1_expand_epilogue (void)
   gcc_assert (amount >= 0);
   if (amount)
     {
+      emit_insn (gen_blockage ());
+
       if (amount < 512)
 	emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
 			       GEN_INT (amount)));
diff --git a/gcc/testsuite/gcc.target/arm/stack-red-zone.c
b/gcc/testsuite/gcc.target/arm/stack-red-zone.c
new file mode 100644
index 0000000..b9f0f99
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/stack-red-zone.c
@@ -0,0 +1,12 @@
+/* No stack red zone.  PR38644.  */
+/* { dg-options "-mthumb -O2" } */
+/* { dg-final { scan-assembler "ldrb\[^\n\]*\\n\[\t \]*add\[\t \]*sp" } }
*/
+
+extern int doStreamReadBlock (int *, char *, int size, int);
+
+char readStream (int *s)
+{
+       char c = 0;
+       doStreamReadBlock (s, &c, 1, *s);
+       return c;
+}





             reply	other threads:[~2011-11-02  2:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02  3:23 Jiangning Liu [this message]
2011-11-16  9:59 ` [PATCH, ARM] Fix stack red zone bug (PR38644) for GCC 4.6 Sebastian Huber
2011-11-16 11:44   ` Ramana Radhakrishnan
2011-12-21  8:44     ` Sebastian Huber
2012-01-09  8:50       ` Sebastian Huber
2012-01-09 16:59         ` Ramana Radhakrishnan
2012-01-10  8:09           ` Sebastian Huber
2011-11-16 10:04 ` [PATCH, ARM] Fix stack red zone bug (PR38644) for GCC 4.5 Sebastian Huber
2011-11-16 15:15   ` Ramana Radhakrishnan
2011-11-16 10:10 ` [PATCH, ARM] Fix stack red zone bug (PR38644) for GCC 4.4 Sebastian Huber
     [not found] <4eb0aabe.101c970a.42b1.ffffb249SMTPIN_ADDED@mx.google.com>
2011-11-02 10:16 ` [PATCH, ARM] Fix stack red zone bug (PR38644) Richard Guenther
2011-11-08  8:43   ` Sebastian Huber
2011-11-08 11:36     ` Richard Guenther
2011-11-08 12:17       ` Sebastian Huber

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='000e01cc9907$01ce9b80$056bd280$@liu@arm.com' \
    --to=jiangning.liu@arm.com \
    --cc=gcc-patches@gcc.gnu.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).