aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.ibm.com>2018-11-20 16:19:54 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2018-11-20 16:19:54 +0000
commit33f3393ab5cc809f2636cc3ce86b3032177c91b8 (patch)
tree844a5c7e059a1d38f8d2473cdc66764f66d73c76 /gcc/tree.c
parent84bfc7328990c247d74c6f6fde4320d11d4403db (diff)
downloadgcc-33f3393ab5cc809f2636cc3ce86b3032177c91b8.zip
gcc-33f3393ab5cc809f2636cc3ce86b3032177c91b8.tar.gz
gcc-33f3393ab5cc809f2636cc3ce86b3032177c91b8.tar.bz2
S/390: Fix flogr RTX.
The flogr instruction uses a 64 bit register pair target operand. In the RTX we model this as a write to a TImode register. Unfortunately the RTX's being assigned to the two parts of the target operand were swapped. This is no problem if in the end the flogr instruction will be emitted since the instruction still does what the clzdi expander expects. However, a problem arises when the RTX is used to optimize CLZ for a constant input operand. Even then it matters only if the expression couldn't be folded on tree level already. In the testcase this happened thanks to loop unrolling on RTL level. The iteration variable is used as an argument to the clz builtin. Due to the loop unrolling it becomes a constant and after folding the broken RTX leads to a wrong assumption. gcc/ChangeLog: 2018-11-20 Andreas Krebbel <krebbel@linux.ibm.com> * config/s390/s390.md ("clztidi2"): Swap the RTX's written to the DImode parts of the target operand. gcc/testsuite/ChangeLog: 2018-11-20 Andreas Krebbel <krebbel@linux.ibm.com> * gcc.target/s390/flogr-1.c: New test. From-SVN: r266321
Diffstat (limited to 'gcc/tree.c')
0 files changed, 0 insertions, 0 deletions