summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-27 15:50:05 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-27 15:50:05 +0000
commitfd3f8d709e9ac641e6378a12ddc9ce090169a98d (patch)
treed2931efd9d30e36b8c46feb3e2e5369830d7614d
parentcd06af47d5868ec9bb3bab60968785db8ae5af70 (diff)
downloadgcc-fd3f8d709e9ac641e6378a12ddc9ce090169a98d.tar.gz
2009-04-27 Richard Guenther <rguenther@suse.de>
PR middle-end/39928 * gimplify.c (gimplify_expr): If we are required to create a temporary make sure it ends up as register. * gcc.c-torture/compile/pr39928-1.c: New testcase. * gcc.c-torture/compile/pr39928-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146846 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimplify.c7
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr39928-1.c8
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr39928-2.c8
5 files changed, 34 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b8bf3437e28..8913e38db5d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-27 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/39928
+ * gimplify.c (gimplify_expr): If we are required to create
+ a temporary make sure it ends up as register.
+
2009-04-27 H.J. Lu <hongjiu.lu@intel.com>
PR target/39903
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index f831e479cac..d886784895f 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -7184,7 +7184,12 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
/* The postqueue might change the value of the expression between
the initialization and use of the temporary, so we can't use a
formal temp. FIXME do we care? */
- *expr_p = get_initialized_tmp_var (*expr_p, pre_p, post_p);
+ {
+ *expr_p = get_initialized_tmp_var (*expr_p, pre_p, post_p);
+ if (TREE_CODE (TREE_TYPE (*expr_p)) == COMPLEX_TYPE
+ || TREE_CODE (TREE_TYPE (*expr_p)) == VECTOR_TYPE)
+ DECL_GIMPLE_REG_P (*expr_p) = 1;
+ }
else
*expr_p = get_formal_tmp_var (*expr_p, pre_p);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9579635ded1..79b0ea129fc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-27 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/39928
+ * gcc.c-torture/compile/pr39928-1.c: New testcase.
+ * gcc.c-torture/compile/pr39928-2.c: Likewise.
+
2009-04-27 H.J. Lu <hongjiu.lu@intel.com>
PR target/39903
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39928-1.c b/gcc/testsuite/gcc.c-torture/compile/pr39928-1.c
new file mode 100644
index 00000000000..3bee4380e5b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr39928-1.c
@@ -0,0 +1,8 @@
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+extern __m128 _mm_sub_ps (__m128 __A, __m128 __B);
+extern __m128 _mm_mul_ps (__m128 __A, __m128 __B);
+__m128
+vq_nbest(const __m128 *codebook, __m128 d, __m128 in)
+{
+ return _mm_sub_ps(d, _mm_mul_ps(in, *codebook++));
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39928-2.c b/gcc/testsuite/gcc.c-torture/compile/pr39928-2.c
new file mode 100644
index 00000000000..6f0d30cc0d1
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr39928-2.c
@@ -0,0 +1,8 @@
+typedef _Complex float __m128;
+extern __m128 _mm_sub_ps (__m128 __A, __m128 __B);
+extern __m128 _mm_mul_ps (__m128 __A, __m128 __B);
+__m128
+vq_nbest(const __m128 *codebook, __m128 d, __m128 in)
+{
+ return _mm_sub_ps(d, _mm_mul_ps(in, *codebook++));
+}