Find a missing test case for https://gcc.gnu.org/ml/gcc-patches/2015-01/msg00789.html left at the corner.
Merged with the latest trunk. New test case does not fail on thumb1/thumb2/arm targets. ChangeLog: 2015-07-24: Joey Ye <joey...@arm.com> * gcc.target/arm/thumb2-pop-single.c: New test. diff --git a/gcc/testsuite/gcc.target/arm/thumb2-pop-single.c b/gcc/testsuite/gcc.target/arm/thumb2-pop-single.c new file mode 100644 index 0000000..f86c633 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/thumb2-pop-single.c @@ -0,0 +1,14 @@ +/* Verify if thumb2 save/restore lr unnecessarily in case of tail call. */ +/* Verify if thumb2 generates pop to restore a single register. */ +/* { dg-do compile { target arm_thumb2 } } */ +/* { dg-options "-Os" } */ +/* { dg-final { scan-assembler-not "push.*lr" } } */ +/* { dg-final { scan-assembler "pop\[\\t \]+\{r\[4-7\]\}" } } */ +extern int +bar (int, int, int, int); + +int +foo (int a, int b, int c, int d) +{ + return bar (b, a, c, d); +}