aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-06-14 00:23:24 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-06-14 00:23:24 +0000
commit9ad58e0979547afaf85fd0edaec5609e07b25ed3 (patch)
treed1c6b35e51dfdd36a8b467ad966b3ec9ea84cce1 /gcc/expr.c
parent307ecf05ae933111daff1f1e5278a637bda3056d (diff)
downloadgcc-9ad58e0979547afaf85fd0edaec5609e07b25ed3.zip
gcc-9ad58e0979547afaf85fd0edaec5609e07b25ed3.tar.gz
gcc-9ad58e0979547afaf85fd0edaec5609e07b25ed3.tar.bz2
expr.c (expand_expr <COMPLEX_CST>): Handle the case of expanding a complex constant into a CONCAT target.
* expr.c (expand_expr <COMPLEX_CST>): Handle the case of expanding a complex constant into a CONCAT target. From-SVN: r67928
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index d4c7e1d..3131a33 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6980,6 +6980,29 @@ expand_expr (exp, target, tmode, modifier)
TYPE_MODE (TREE_TYPE (exp)));
case COMPLEX_CST:
+ /* Handle evaluating a complex constant in a CONCAT target. */
+ if (original_target && GET_CODE (original_target) == CONCAT)
+ {
+ enum machine_mode mode = TYPE_MODE (TREE_TYPE (TREE_TYPE (exp)));
+ rtx rtarg, itarg;
+
+ rtarg = XEXP (original_target, 0);
+ itarg = XEXP (original_target, 1);
+
+ /* Move the real and imaginary parts separately. */
+ op0 = expand_expr (TREE_REALPART (exp), rtarg, mode, 0);
+ op1 = expand_expr (TREE_IMAGPART (exp), itarg, mode, 0);
+
+ if (op0 != rtarg)
+ emit_move_insn (rtarg, op0);
+ if (op1 != itarg)
+ emit_move_insn (itarg, op1);
+
+ return original_target;
+ }
+
+ /* ... fall through ... */
+
case STRING_CST:
temp = output_constant_def (exp, 1);