Message ID | 4EC37370.6000501@embedded-brains.de |
---|---|
State | New |
Headers | show |
On 16 November 2011 08:25, Sebastian Huber <sebastian.huber@embedded-brains.de> wrote: > 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.5 branch. I didn't run the test suite. I only > compiled the arm-eabi-gcc and checked that this patch fixes the test case. > Please make sure you run the testsuite for both 4.5 and 4.4 in case you want them backported there. Ramana > -- > 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. > >
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 08208b7..16325bb 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -19408,6 +19408,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; +}