diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2019-01-25 13:29:06 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco@gcc.gnu.org> | 2019-01-25 13:29:06 +0000 |
commit | f73dc006049cd217fdd2fa943b861ad9f517aa66 (patch) | |
tree | 0e78f46d34616689a142cafe5f64d7bc16046651 /gcc | |
parent | cb1ba35f582f07096a045574b571576bdcc439a9 (diff) | |
download | gcc-f73dc006049cd217fdd2fa943b861ad9f517aa66.zip gcc-f73dc006049cd217fdd2fa943b861ad9f517aa66.tar.gz gcc-f73dc006049cd217fdd2fa943b861ad9f517aa66.tar.bz2 |
[PATCH][AArch64] Fix generation of tst (PR87763)
The TST instruction no longer matches in all cases due to changes in
Combine. The fix is simple, we now need to allow a subreg as well when
selecting the cc_mode. This fixes the tst_5.c and tst_6.c failures.
AArch64 regress & bootstrap OK.
PR rtl-optimization/87763
* config/aarch64/aarch64.c (aarch64_select_cc_mode):
Allow SUBREG when matching CC_NZmode compare.
From-SVN: r268265
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cc4f441..8779446 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-01-25 Wilco Dijkstra <wdijkstr@arm.com> + + PR rtl-optimization/87763 + * config/aarch64/aarch64.c (aarch64_select_cc_mode): + Allow SUBREG when matching CC_NZmode compare. + 2019-01-25 Richard Biener <rguenther@suse.de> PR tree-optimization/89049 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 5df5a8b..8bddff9 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -7163,7 +7163,7 @@ aarch64_select_cc_mode (RTX_CODE code, rtx x, rtx y) /* Equality comparisons of short modes against zero can be performed using the TST instruction with the appropriate bitmask. */ - if (y == const0_rtx && REG_P (x) + if (y == const0_rtx && (REG_P (x) || SUBREG_P (x)) && (code == EQ || code == NE) && (mode_x == HImode || mode_x == QImode)) return CC_NZmode; |