expr.c (expand_expr <COMPLEX_CST>): Handle the case of expanding a complex constant...
authorRoger Sayle <roger@eyesopen.com>
Sat, 14 Jun 2003 00:23:24 +0000 (00:23 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sat, 14 Jun 2003 00:23:24 +0000 (00:23 +0000)
* expr.c (expand_expr <COMPLEX_CST>): Handle the case of
expanding a complex constant into a CONCAT target.

From-SVN: r67928

gcc/ChangeLog
gcc/expr.c

index c1db08a1aaef93474e2dc6ceec6fc669be10ea04..4737fa0e3c55c2835cb4657d0fd0fd44720742e6 100644 (file)
@@ -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.
index d4c7e1d9df4ff2285856c4d4badc849fa6776dcd..3131a33e50d4da345a556698301d2f17d9dc29d6 100644 (file)
@@ -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);