public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH, ARM] Fix stack red zone bug (PR38644) for GCC 4.6
Date: Wed, 16 Nov 2011 09:59:00 -0000	[thread overview]
Message-ID: <4EC37307.6030206@embedded-brains.de> (raw)
In-Reply-To: <000e01cc9907$01ce9b80$056bd280$@liu@arm.com>

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

Hi,

this is Jiangning Liu's patch to fix PR38644 in ARM back-end

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38644.

intended for the GCC 4.6 branch.  Test results:

http://gcc.gnu.org/ml/gcc-testresults/2011-11/msg01619.html

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

[-- Attachment #2: pr38644-4.6.patch --]
[-- Type: text/x-patch, Size: 1342 bytes --]

ChangeLog:

2011-11-04  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-04  Jiangning Liu  <jiangning.liu@arm.com>

        PR rtl-optimization/38644
        * gcc.target/arm/stack-red-zone.c: New.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 75174a3..acdfbd5 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -20864,6 +20864,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-16  8:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02  3:23 [PATCH, ARM] Fix stack red zone bug (PR38644) Jiangning Liu
2011-11-16  9:59 ` Sebastian Huber [this message]
2011-11-16 11:44   ` [PATCH, ARM] Fix stack red zone bug (PR38644) for GCC 4.6 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

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=4EC37307.6030206@embedded-brains.de \
    --to=sebastian.huber@embedded-brains.de \
    --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).