aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJiangning Liu <jiangning.liu@arm.com>2011-11-04 16:50:04 +0000
committerJoey Ye <jye2@gcc.gnu.org>2011-11-04 16:50:04 +0000
commite98925f693e27eed776eb7ee8191003a97981d21 (patch)
treeceaffa105c789fb7507175295cf5c3c25f297eaf /gcc
parent92b4d64cd44cbf3ecdc9be35099ed8692e3fc7ab (diff)
downloadgcc-e98925f693e27eed776eb7ee8191003a97981d21.zip
gcc-e98925f693e27eed776eb7ee8191003a97981d21.tar.gz
gcc-e98925f693e27eed776eb7ee8191003a97981d21.tar.bz2
re PR rtl-optimization/38644 (Optimization flag -O1 -fschedule-insns2 causes wrong code)
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. testcase: * gcc.target/arm/stack-red-zone.c: New. From-SVN: r180964
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/arm/arm.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/arm/stack-red-zone.c12
4 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d6e9551..2c2c154 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2011-11-04 Georg-Johann Lay <avr@gjlay.de>
PR target/50931
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 5f0d562..6ef6f62 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -22216,6 +22216,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/ChangeLog b/gcc/testsuite/ChangeLog
index d5a6ea5..f47a503 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-04 Jiangning Liu <jiangning.liu@arm.com>
+
+ PR rtl-optimization/38644
+ * gcc.target/arm/stack-red-zone.c: New.
+
2011-11-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/48420
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;
+}