diff options
author | Zhenqiang Chen <zhenqiang.chen@arm.com> | 2014-08-14 04:47:43 +0000 |
---|---|---|
committer | Zhenqiang Chen <zqchen@gcc.gnu.org> | 2014-08-14 04:47:43 +0000 |
commit | 4d2df0f4704665c047d84b195a5c1a2ba9b7a28b (patch) | |
tree | 9929a93d5329d82ce44d3538a0525e148fc080a3 /gcc | |
parent | 0b3a20e31d96b6344daef97cb16540d19723ea0a (diff) | |
download | gcc-4d2df0f4704665c047d84b195a5c1a2ba9b7a28b.zip gcc-4d2df0f4704665c047d84b195a5c1a2ba9b7a28b.tar.gz gcc-4d2df0f4704665c047d84b195a5c1a2ba9b7a28b.tar.bz2 |
arm.c (arm_option_override): Set max_insns_skipped to MAX_INSN_PER_IT_BLOCK when optimize_size for THUMB2.
ChangeLog:
2014-08-14 Zhenqiang Chen <zhenqiang.chen@arm.com>
* config/arm/arm.c (arm_option_override): Set max_insns_skipped
to MAX_INSN_PER_IT_BLOCK when optimize_size for THUMB2.
testsuite/ChangeLog:
2014-08-14 Zhenqiang Chen <zhenqiang.chen@arm.com>
* gcc.target/arm/max-insns-skipped.c: New test.
From-SVN: r213939
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/arm/max-insns-skipped.c | 21 |
4 files changed, 34 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e58c7e1..50b38fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-08-14 Zhenqiang Chen <zhenqiang.chen@arm.com> + + * config/arm/arm.c (arm_option_override): Set max_insns_skipped + to MAX_INSN_PER_IT_BLOCK when optimize_size for THUMB2. + 2014-08-13 Chen Gang gang.chen.5i5j@gmail.com * microblaze/microblaze.md: Remove redundant '@' to avoid compiling diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 7f62ca4..2f8d327 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2989,6 +2989,10 @@ arm_option_override (void) /* If optimizing for size, bump the number of instructions that we are prepared to conditionally execute (even on a StrongARM). */ max_insns_skipped = 6; + + /* For THUMB2, we limit the conditional sequence to one IT block. */ + if (TARGET_THUMB2) + max_insns_skipped = MAX_INSN_PER_IT_BLOCK; } else max_insns_skipped = current_tune->max_insns_skipped; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e122b50..ad9cce2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-08-14 Zhenqiang Chen <zhenqiang.chen@arm.com> + + * gcc.target/arm/max-insns-skipped.c: New test. + 2014-08-14 Bin Cheng <bin.cheng@arm.com> * c-c++-common/addrtmp.c: Add bind_pic_locally option. diff --git a/gcc/testsuite/gcc.target/arm/max-insns-skipped.c b/gcc/testsuite/gcc.target/arm/max-insns-skipped.c new file mode 100644 index 0000000..0a11554 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/max-insns-skipped.c @@ -0,0 +1,21 @@ +/* { dg-do assemble { target arm_thumb2 } } */ +/* { dg-options " -Os " } */ + +int t (int a, int b, int c, int d) +{ + int r; + if (a > 0) { + r = a + b; + r += 0x456; + r *= 0x1234567; + } + else { + r = b - a; + r -= 0x123; + r *= 0x12387; + r += d; + } + return r; +} + +/* { dg-final { object-size text <= 40 } } */ |