This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] add test for target/17381 - Unnecessary register move for float extend
- From: Martin Sebor <msebor at gmail dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Wed, 27 Jan 2016 15:38:13 -0700
- Subject: [PATCH] add test for target/17381 - Unnecessary register move for float extend
- Authentication-results: sourceware.org; auth=none
The attached patch adds a test for the apparently long fixed
bug.
FWIW, I've been trying to close out some of these old bugs and
while it doesn't seem to be done consistently, it occurs to me
that it might be nice to add tests for them. Please let me
know if you don't think it's worth the trouble (not just mine
but also reviewing the tests and maintaining them).
Martin
PR target/17381 - Unnecessary register move for float extend
gcc/testsuite/ChangeLog:
2016-01-27 Martin Sebor <msebor@redhat.com>
PR target/17381
* gcc.target/powerpc/pr17381.c: New test.
Index: gcc/testsuite/gcc.target/powerpc/pr17381.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/pr17381.c (revision 0)
+++ gcc/testsuite/gcc.target/powerpc/pr17381.c (working copy)
@@ -0,0 +1,11 @@
+/* PR target/17381 - Unnecessary register move for float extend */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+double d;
+float test1(float fParm)
+{
+ d = fParm + 1.0;
+ return fParm + 1.0f;
+}
+/* { dg-final { scan-assembler-times "fmr" 1 } } */