aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2020-08-04 16:56:06 +0100
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 15:07:33 -0300
commit0361fd3e89ab2a3cb68f15c22a4c5dea52b196e0 (patch)
treefad25755e3e79fe0d88eca603e9ebee24f8741ec
parentb1e9d65bf185e9e3807257d54377878c954a0873 (diff)
downloadgcc-0361fd3e89ab2a3cb68f15c22a4c5dea52b196e0.zip
gcc-0361fd3e89ab2a3cb68f15c22a4c5dea52b196e0.tar.gz
gcc-0361fd3e89ab2a3cb68f15c22a4c5dea52b196e0.tar.bz2
Test case for PR rtl-optimization/60473
PR rtl-optimization/60473 is code quality regression that has been cured by improvements to register allocation. For the function in the test case, GCC 4.4, 4.5 and 4.6 generated very poor code requiring two mov instructions, and GCC 4.7 and 4.8 (when the PR was filed) produced better but still poor code with one mov instruction. Since GCC 4.9 (including current mainline), it generates optimal code with no mov instructions, matching what used to be generated in GCC 4.1. 2020-08-04 Roger Sayle <roger@nextmovesoftware.com> gcc/testsuite/ChangeLog PR rtl-optimization/60473 * gcc.target/i386/pr60473.c: New test.
-rw-r--r--gcc/testsuite/gcc.target/i386/pr60473.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr60473.c b/gcc/testsuite/gcc.target/i386/pr60473.c
new file mode 100644
index 0000000..d81962e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr60473.c
@@ -0,0 +1,12 @@
+/* PR rtl-optimization/60473 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2" } */
+
+unsigned long long foo()
+{
+ unsigned long long h,l;
+ asm volatile ("rdtsc": "=a" (l), "=d" (h));
+ return l | (h << 32);
+}
+
+/* { dg-final { scan-assembler-not "mov" } } */