summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-14 00:23:24 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-14 00:23:24 +0000
commit67cae17de23d17d2d7965a48e52faa34c7b1eea9 (patch)
treed1c6b35e51dfdd36a8b467ad966b3ec9ea84cce1 /gcc
parent6f812203aaa99db5131d96adfe4f04734951e917 (diff)
downloadgcc-67cae17de23d17d2d7965a48e52faa34c7b1eea9.tar.gz
* expr.c (expand_expr <COMPLEX_CST>): Handle the case of
expanding a complex constant into a CONCAT target. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67928 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expr.c23
2 files changed, 28 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c1db08a1aae..4737fa0e3c5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2003-06-13 Roger Sayle <roger@eyesopen.com>
+
+ * expr.c (expand_expr <COMPLEX_CST>): Handle the case of
+ expanding a complex constant into a CONCAT target.
+
2003-06-13 Zack Weinberg <zack@codesourcery.com>
* config/svr3.h (ASM_FILE_START): Don't use ASM_FILE_START_1.
diff --git a/gcc/expr.c b/gcc/expr.c
index d4c7e1d9df4..3131a33e50d 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);