1 /* Lower complex number operations to scalar operations.
2 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 GCC is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING. If not, write to the Free
18 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
23 #include "coretypes.h"
29 #include "tree-flow.h"
30 #include "tree-gimple.h"
31 #include "tree-iterator.h"
32 #include "tree-pass.h"
33 #include "tree-ssa-propagate.h"
34 #include "diagnostic.h"
37 /* For each complex ssa name, a lattice value. We're interested in finding
38 out whether a complex number is degenerate in some way, having only real
39 or only complex parts. */
49 #define PAIR(a, b) ((a) << 2 | (b))
51 DEF_VEC_I(complex_lattice_t
);
52 DEF_VEC_ALLOC_I(complex_lattice_t
, heap
);
54 static VEC(complex_lattice_t
, heap
) *complex_lattice_values
;
56 /* For each complex variable, a pair of variables for the components exists in
58 static htab_t complex_variable_components
;
60 /* For each complex SSA_NAME, a pair of ssa names for the components. */
61 static VEC(tree
, heap
) *complex_ssa_name_components
;
63 /* Lookup UID in the complex_variable_components hashtable and return the
66 cvc_lookup (unsigned int uid
)
68 struct int_tree_map
*h
, in
;
70 h
= htab_find_with_hash (complex_variable_components
, &in
, uid
);
71 return h
? h
->to
: NULL
;
74 /* Insert the pair UID, TO into the complex_variable_components hashtable. */
77 cvc_insert (unsigned int uid
, tree to
)
79 struct int_tree_map
*h
;
82 h
= xmalloc (sizeof (struct int_tree_map
));
85 loc
= htab_find_slot_with_hash (complex_variable_components
, h
,
87 *(struct int_tree_map
**) loc
= h
;
90 /* Return true if T is not a zero constant. In the case of real values,
91 we're only interested in +0.0. */
94 some_nonzerop (tree t
)
98 if (TREE_CODE (t
) == REAL_CST
)
99 zerop
= REAL_VALUES_IDENTICAL (TREE_REAL_CST (t
), dconst0
);
100 else if (TREE_CODE (t
) == INTEGER_CST
)
101 zerop
= integer_zerop (t
);
106 /* Compute a lattice value from T. It may be a gimple_val, or, as a
107 special exception, a COMPLEX_EXPR. */
109 static complex_lattice_t
110 find_lattice_value (tree t
)
114 complex_lattice_t ret
;
116 switch (TREE_CODE (t
))
119 return VEC_index (complex_lattice_t
, complex_lattice_values
,
120 SSA_NAME_VERSION (t
));
123 real
= TREE_REALPART (t
);
124 imag
= TREE_IMAGPART (t
);
128 real
= TREE_OPERAND (t
, 0);
129 imag
= TREE_OPERAND (t
, 1);
136 r
= some_nonzerop (real
);
137 i
= some_nonzerop (imag
);
138 ret
= r
*ONLY_REAL
+ i
*ONLY_IMAG
;
140 /* ??? On occasion we could do better than mapping 0+0i to real, but we
141 certainly don't want to leave it UNINITIALIZED, which eventually gets
142 mapped to VARYING. */
143 if (ret
== UNINITIALIZED
)
149 /* Determine if LHS is something for which we're interested in seeing
150 simulation results. */
153 is_complex_reg (tree lhs
)
155 return TREE_CODE (TREE_TYPE (lhs
)) == COMPLEX_TYPE
&& is_gimple_reg (lhs
);
158 /* Mark the incoming parameters to the function as VARYING. */
161 init_parameter_lattice_values (void)
165 for (parm
= DECL_ARGUMENTS (cfun
->decl
); parm
; parm
= TREE_CHAIN (parm
))
166 if (is_complex_reg (parm
) && var_ann (parm
) != NULL
)
168 tree ssa_name
= default_def (parm
);
169 VEC_replace (complex_lattice_t
, complex_lattice_values
,
170 SSA_NAME_VERSION (ssa_name
), VARYING
);
174 /* Initialize DONT_SIMULATE_AGAIN for each stmt and phi. Return false if
175 we found no statements we want to simulate, and thus there's nothing for
176 the entire pass to do. */
179 init_dont_simulate_again (void)
182 block_stmt_iterator bsi
;
184 bool saw_a_complex_op
= false;
188 for (phi
= phi_nodes (bb
); phi
; phi
= PHI_CHAIN (phi
))
189 DONT_SIMULATE_AGAIN (phi
) = !is_complex_reg (PHI_RESULT (phi
));
191 for (bsi
= bsi_start (bb
); !bsi_end_p (bsi
); bsi_next (&bsi
))
193 tree orig_stmt
, stmt
, rhs
= NULL
;
196 orig_stmt
= stmt
= bsi_stmt (bsi
);
198 /* Most control-altering statements must be initially
199 simulated, else we won't cover the entire cfg. */
200 dsa
= !stmt_ends_bb_p (stmt
);
202 switch (TREE_CODE (stmt
))
205 /* We don't care what the lattice value of <retval> is,
206 since it's never used as an input to another computation. */
208 stmt
= TREE_OPERAND (stmt
, 0);
209 if (!stmt
|| TREE_CODE (stmt
) != MODIFY_EXPR
)
214 dsa
= !is_complex_reg (TREE_OPERAND (stmt
, 0));
215 rhs
= TREE_OPERAND (stmt
, 1);
219 rhs
= TREE_OPERAND (stmt
, 0);
227 switch (TREE_CODE (rhs
))
231 rhs
= TREE_OPERAND (rhs
, 0);
244 if (TREE_CODE (TREE_TYPE (rhs
)) == COMPLEX_TYPE
)
245 saw_a_complex_op
= true;
252 DONT_SIMULATE_AGAIN (orig_stmt
) = dsa
;
256 return saw_a_complex_op
;
260 /* Evaluate statement STMT against the complex lattice defined above. */
262 static enum ssa_prop_result
263 complex_visit_stmt (tree stmt
, edge
*taken_edge_p ATTRIBUTE_UNUSED
,
266 complex_lattice_t new_l
, old_l
, op1_l
, op2_l
;
270 if (TREE_CODE (stmt
) != MODIFY_EXPR
)
271 return SSA_PROP_VARYING
;
273 lhs
= TREE_OPERAND (stmt
, 0);
274 rhs
= TREE_OPERAND (stmt
, 1);
276 /* These conditions should be satisfied due to the initial filter
277 set up in init_dont_simulate_again. */
278 gcc_assert (TREE_CODE (lhs
) == SSA_NAME
);
279 gcc_assert (TREE_CODE (TREE_TYPE (lhs
)) == COMPLEX_TYPE
);
282 ver
= SSA_NAME_VERSION (lhs
);
283 old_l
= VEC_index (complex_lattice_t
, complex_lattice_values
, ver
);
285 switch (TREE_CODE (rhs
))
290 new_l
= find_lattice_value (rhs
);
295 op1_l
= find_lattice_value (TREE_OPERAND (rhs
, 0));
296 op2_l
= find_lattice_value (TREE_OPERAND (rhs
, 1));
298 /* We've set up the lattice values such that IOR neatly
300 new_l
= op1_l
| op2_l
;
309 op1_l
= find_lattice_value (TREE_OPERAND (rhs
, 0));
310 op2_l
= find_lattice_value (TREE_OPERAND (rhs
, 1));
312 /* Obviously, if either varies, so does the result. */
313 if (op1_l
== VARYING
|| op2_l
== VARYING
)
315 /* Don't prematurely promote variables if we've not yet seen
317 else if (op1_l
== UNINITIALIZED
)
319 else if (op2_l
== UNINITIALIZED
)
323 /* At this point both numbers have only one component. If the
324 numbers are of opposite kind, the result is imaginary,
325 otherwise the result is real. The add/subtract translates
326 the real/imag from/to 0/1; the ^ performs the comparison. */
327 new_l
= ((op1_l
- ONLY_REAL
) ^ (op2_l
- ONLY_REAL
)) + ONLY_REAL
;
329 /* Don't allow the lattice value to flip-flop indefinitely. */
336 new_l
= find_lattice_value (TREE_OPERAND (rhs
, 0));
344 /* If nothing changed this round, let the propagator know. */
346 return SSA_PROP_NOT_INTERESTING
;
348 VEC_replace (complex_lattice_t
, complex_lattice_values
, ver
, new_l
);
349 return new_l
== VARYING
? SSA_PROP_VARYING
: SSA_PROP_INTERESTING
;
352 /* Evaluate a PHI node against the complex lattice defined above. */
354 static enum ssa_prop_result
355 complex_visit_phi (tree phi
)
357 complex_lattice_t new_l
, old_l
;
362 lhs
= PHI_RESULT (phi
);
364 /* This condition should be satisfied due to the initial filter
365 set up in init_dont_simulate_again. */
366 gcc_assert (TREE_CODE (TREE_TYPE (lhs
)) == COMPLEX_TYPE
);
368 /* We've set up the lattice values such that IOR neatly models PHI meet. */
369 new_l
= UNINITIALIZED
;
370 for (i
= PHI_NUM_ARGS (phi
) - 1; i
>= 0; --i
)
371 new_l
|= find_lattice_value (PHI_ARG_DEF (phi
, i
));
373 ver
= SSA_NAME_VERSION (lhs
);
374 old_l
= VEC_index (complex_lattice_t
, complex_lattice_values
, ver
);
377 return SSA_PROP_NOT_INTERESTING
;
379 VEC_replace (complex_lattice_t
, complex_lattice_values
, ver
, new_l
);
380 return new_l
== VARYING
? SSA_PROP_VARYING
: SSA_PROP_INTERESTING
;
383 /* Create one backing variable for a complex component of ORIG. */
386 create_one_component_var (tree type
, tree orig
, const char *prefix
,
387 const char *suffix
, enum tree_code code
)
389 tree r
= create_tmp_var (type
, prefix
);
390 add_referenced_tmp_var (r
);
392 DECL_SOURCE_LOCATION (r
) = DECL_SOURCE_LOCATION (orig
);
393 DECL_ARTIFICIAL (r
) = 1;
395 if (DECL_NAME (orig
) && !DECL_IGNORED_P (orig
))
397 const char *name
= IDENTIFIER_POINTER (DECL_NAME (orig
));
400 DECL_NAME (r
) = get_identifier (ACONCAT ((name
, suffix
, NULL
)));
402 inner_type
= TREE_TYPE (TREE_TYPE (orig
));
403 SET_DECL_DEBUG_EXPR (r
, build1 (code
, type
, orig
));
404 DECL_DEBUG_EXPR_IS_FROM (r
) = 1;
405 DECL_IGNORED_P (r
) = 0;
406 TREE_NO_WARNING (r
) = TREE_NO_WARNING (orig
);
410 DECL_IGNORED_P (r
) = 1;
411 TREE_NO_WARNING (r
) = 1;
417 /* Retrieve a value for a complex component of VAR. */
420 get_component_var (tree var
, bool imag_p
)
422 size_t decl_index
= DECL_UID (var
) * 2 + imag_p
;
423 tree ret
= cvc_lookup (decl_index
);
427 ret
= create_one_component_var (TREE_TYPE (TREE_TYPE (var
)), var
,
428 imag_p
? "CI" : "CR",
429 imag_p
? "$imag" : "$real",
430 imag_p
? IMAGPART_EXPR
: REALPART_EXPR
);
431 cvc_insert (decl_index
, ret
);
437 /* Retrieve a value for a complex component of SSA_NAME. */
440 get_component_ssa_name (tree ssa_name
, bool imag_p
)
442 complex_lattice_t lattice
= find_lattice_value (ssa_name
);
443 size_t ssa_name_index
;
446 if (lattice
== (imag_p
? ONLY_REAL
: ONLY_IMAG
))
448 tree inner_type
= TREE_TYPE (TREE_TYPE (ssa_name
));
449 if (SCALAR_FLOAT_TYPE_P (inner_type
))
450 return build_real (inner_type
, dconst0
);
452 return build_int_cst (inner_type
, 0);
455 ssa_name_index
= SSA_NAME_VERSION (ssa_name
) * 2 + imag_p
;
456 ret
= VEC_index (tree
, complex_ssa_name_components
, ssa_name_index
);
459 ret
= get_component_var (SSA_NAME_VAR (ssa_name
), imag_p
);
460 ret
= make_ssa_name (ret
, NULL
);
462 /* Copy some properties from the original. In particular, whether it
463 is used in an abnormal phi, and whether it's uninitialized. */
464 SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ret
)
465 = SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ssa_name
);
466 if (TREE_CODE (SSA_NAME_VAR (ssa_name
)) == VAR_DECL
467 && IS_EMPTY_STMT (SSA_NAME_DEF_STMT (ssa_name
)))
469 SSA_NAME_DEF_STMT (ret
) = SSA_NAME_DEF_STMT (ssa_name
);
470 set_default_def (SSA_NAME_VAR (ret
), ret
);
473 VEC_replace (tree
, complex_ssa_name_components
, ssa_name_index
, ret
);
479 /* Set a value for a complex component of SSA_NAME, return a STMT_LIST of
480 stuff that needs doing. */
483 set_component_ssa_name (tree ssa_name
, bool imag_p
, tree value
)
485 complex_lattice_t lattice
= find_lattice_value (ssa_name
);
486 size_t ssa_name_index
;
487 tree comp
, list
, last
;
489 /* We know the value must be zero, else there's a bug in our lattice
490 analysis. But the value may well be a variable known to contain
491 zero. We should be safe ignoring it. */
492 if (lattice
== (imag_p
? ONLY_REAL
: ONLY_IMAG
))
495 /* If we've already assigned an SSA_NAME to this component, then this
496 means that our walk of the basic blocks found a use before the set.
497 This is fine. Now we should create an initialization for the value
498 we created earlier. */
499 ssa_name_index
= SSA_NAME_VERSION (ssa_name
) * 2 + imag_p
;
500 comp
= VEC_index (tree
, complex_ssa_name_components
, ssa_name_index
);
504 /* If we've nothing assigned, and the value we're given is already stable,
505 then install that as the value for this SSA_NAME. This preemptively
506 copy-propagates the value, which avoids unnecessary memory allocation. */
507 else if (is_gimple_min_invariant (value
))
509 VEC_replace (tree
, complex_ssa_name_components
, ssa_name_index
, value
);
512 else if (TREE_CODE (value
) == SSA_NAME
513 && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ssa_name
))
515 /* Replace an anonymous base value with the variable from cvc_lookup.
516 This should result in better debug info. */
517 if (DECL_IGNORED_P (SSA_NAME_VAR (value
))
518 && !DECL_IGNORED_P (SSA_NAME_VAR (ssa_name
)))
520 comp
= get_component_var (SSA_NAME_VAR (ssa_name
), imag_p
);
521 replace_ssa_name_symbol (value
, comp
);
524 VEC_replace (tree
, complex_ssa_name_components
, ssa_name_index
, value
);
528 /* Finally, we need to stabilize the result by installing the value into
531 comp
= get_component_ssa_name (ssa_name
, imag_p
);
533 /* Do all the work to assign VALUE to COMP. */
534 value
= force_gimple_operand (value
, &list
, false, NULL
);
535 last
= build2 (MODIFY_EXPR
, TREE_TYPE (comp
), comp
, value
);
536 append_to_statement_list (last
, &list
);
538 gcc_assert (SSA_NAME_DEF_STMT (comp
) == NULL
);
539 SSA_NAME_DEF_STMT (comp
) = last
;
544 /* Extract the real or imaginary part of a complex variable or constant.
545 Make sure that it's a proper gimple_val and gimplify it if not.
546 Emit any new code before BSI. */
549 extract_component (block_stmt_iterator
*bsi
, tree t
, bool imagpart_p
,
552 switch (TREE_CODE (t
))
555 return imagpart_p
? TREE_IMAGPART (t
) : TREE_REALPART (t
);
558 return TREE_OPERAND (t
, imagpart_p
);
566 tree inner_type
= TREE_TYPE (TREE_TYPE (t
));
568 t
= build1 ((imagpart_p
? IMAGPART_EXPR
: REALPART_EXPR
),
569 inner_type
, unshare_expr (t
));
572 t
= gimplify_val (bsi
, inner_type
, t
);
578 return get_component_ssa_name (t
, imagpart_p
);
585 /* Update the complex components of the ssa name on the lhs of STMT. */
588 update_complex_components (block_stmt_iterator
*bsi
, tree stmt
, tree r
, tree i
)
590 tree lhs
= TREE_OPERAND (stmt
, 0);
593 list
= set_component_ssa_name (lhs
, false, r
);
595 bsi_insert_after (bsi
, list
, BSI_CONTINUE_LINKING
);
597 list
= set_component_ssa_name (lhs
, true, i
);
599 bsi_insert_after (bsi
, list
, BSI_CONTINUE_LINKING
);
603 update_complex_components_on_edge (edge e
, tree lhs
, tree r
, tree i
)
607 list
= set_component_ssa_name (lhs
, false, r
);
609 bsi_insert_on_edge (e
, list
);
611 list
= set_component_ssa_name (lhs
, true, i
);
613 bsi_insert_on_edge (e
, list
);
616 /* Update an assignment to a complex variable in place. */
619 update_complex_assignment (block_stmt_iterator
*bsi
, tree r
, tree i
)
624 mod
= stmt
= bsi_stmt (*bsi
);
625 if (TREE_CODE (stmt
) == RETURN_EXPR
)
626 mod
= TREE_OPERAND (mod
, 0);
628 update_complex_components (bsi
, stmt
, r
, i
);
630 type
= TREE_TYPE (TREE_OPERAND (mod
, 1));
631 TREE_OPERAND (mod
, 1) = build (COMPLEX_EXPR
, type
, r
, i
);
635 /* Generate code at the entry point of the function to initialize the
636 component variables for a complex parameter. */
639 update_parameter_components (void)
641 edge entry_edge
= single_succ_edge (ENTRY_BLOCK_PTR
);
644 for (parm
= DECL_ARGUMENTS (cfun
->decl
); parm
; parm
= TREE_CHAIN (parm
))
646 tree type
= TREE_TYPE (parm
);
649 if (TREE_CODE (type
) != COMPLEX_TYPE
|| !is_gimple_reg (parm
))
652 type
= TREE_TYPE (type
);
653 ssa_name
= default_def (parm
);
655 r
= build1 (REALPART_EXPR
, type
, ssa_name
);
656 i
= build1 (IMAGPART_EXPR
, type
, ssa_name
);
657 update_complex_components_on_edge (entry_edge
, ssa_name
, r
, i
);
661 /* Generate code to set the component variables of a complex variable
662 to match the PHI statements in block BB. */
665 update_phi_components (basic_block bb
)
669 for (phi
= phi_nodes (bb
); phi
; phi
= PHI_CHAIN (phi
))
670 if (is_complex_reg (PHI_RESULT (phi
)))
672 tree lr
, li
, pr
= NULL
, pi
= NULL
;
675 lr
= get_component_ssa_name (PHI_RESULT (phi
), false);
676 if (TREE_CODE (lr
) == SSA_NAME
)
678 pr
= create_phi_node (lr
, bb
);
679 SSA_NAME_DEF_STMT (lr
) = pr
;
682 li
= get_component_ssa_name (PHI_RESULT (phi
), true);
683 if (TREE_CODE (li
) == SSA_NAME
)
685 pi
= create_phi_node (li
, bb
);
686 SSA_NAME_DEF_STMT (li
) = pi
;
689 for (i
= 0, n
= PHI_NUM_ARGS (phi
); i
< n
; ++i
)
691 tree comp
, arg
= PHI_ARG_DEF (phi
, i
);
694 comp
= extract_component (NULL
, arg
, false, false);
695 SET_PHI_ARG_DEF (pr
, i
, comp
);
699 comp
= extract_component (NULL
, arg
, true, false);
700 SET_PHI_ARG_DEF (pi
, i
, comp
);
706 /* Mark each virtual op in STMT for ssa update. */
709 update_all_vops (tree stmt
)
714 FOR_EACH_SSA_TREE_OPERAND (sym
, stmt
, iter
, SSA_OP_ALL_VIRTUALS
)
716 if (TREE_CODE (sym
) == SSA_NAME
)
717 sym
= SSA_NAME_VAR (sym
);
718 mark_sym_for_renaming (sym
);
722 /* Expand a complex move to scalars. */
725 expand_complex_move (block_stmt_iterator
*bsi
, tree stmt
, tree type
,
728 tree inner_type
= TREE_TYPE (type
);
731 if (TREE_CODE (lhs
) == SSA_NAME
)
733 if (is_ctrl_altering_stmt (bsi_stmt (*bsi
)))
738 /* The value is not assigned on the exception edges, so we need not
739 concern ourselves there. We do need to update on the fallthru
741 FOR_EACH_EDGE (e
, ei
, bsi
->bb
->succs
)
742 if (e
->flags
& EDGE_FALLTHRU
)
747 r
= build1 (REALPART_EXPR
, inner_type
, lhs
);
748 i
= build1 (IMAGPART_EXPR
, inner_type
, lhs
);
749 update_complex_components_on_edge (e
, lhs
, r
, i
);
751 else if (TREE_CODE (rhs
) == CALL_EXPR
|| TREE_SIDE_EFFECTS (rhs
))
753 r
= build1 (REALPART_EXPR
, inner_type
, lhs
);
754 i
= build1 (IMAGPART_EXPR
, inner_type
, lhs
);
755 update_complex_components (bsi
, stmt
, r
, i
);
759 update_all_vops (bsi_stmt (*bsi
));
760 r
= extract_component (bsi
, rhs
, 0, true);
761 i
= extract_component (bsi
, rhs
, 1, true);
762 update_complex_assignment (bsi
, r
, i
);
765 else if (TREE_CODE (rhs
) == SSA_NAME
&& !TREE_SIDE_EFFECTS (lhs
))
769 r
= extract_component (bsi
, rhs
, 0, false);
770 i
= extract_component (bsi
, rhs
, 1, false);
772 x
= build1 (REALPART_EXPR
, inner_type
, unshare_expr (lhs
));
773 x
= build2 (MODIFY_EXPR
, inner_type
, x
, r
);
774 bsi_insert_before (bsi
, x
, BSI_SAME_STMT
);
776 if (stmt
== bsi_stmt (*bsi
))
778 x
= build1 (IMAGPART_EXPR
, inner_type
, unshare_expr (lhs
));
779 TREE_OPERAND (stmt
, 0) = x
;
780 TREE_OPERAND (stmt
, 1) = i
;
781 TREE_TYPE (stmt
) = inner_type
;
785 x
= build1 (IMAGPART_EXPR
, inner_type
, unshare_expr (lhs
));
786 x
= build2 (MODIFY_EXPR
, inner_type
, x
, i
);
787 bsi_insert_before (bsi
, x
, BSI_SAME_STMT
);
789 stmt
= bsi_stmt (*bsi
);
790 gcc_assert (TREE_CODE (stmt
) == RETURN_EXPR
);
791 TREE_OPERAND (stmt
, 0) = lhs
;
794 update_all_vops (stmt
);
799 /* Expand complex addition to scalars:
800 a + b = (ar + br) + i(ai + bi)
801 a - b = (ar - br) + i(ai + bi)
805 expand_complex_addition (block_stmt_iterator
*bsi
, tree inner_type
,
806 tree ar
, tree ai
, tree br
, tree bi
,
808 complex_lattice_t al
, complex_lattice_t bl
)
812 switch (PAIR (al
, bl
))
814 case PAIR (ONLY_REAL
, ONLY_REAL
):
815 rr
= gimplify_build2 (bsi
, code
, inner_type
, ar
, br
);
819 case PAIR (ONLY_REAL
, ONLY_IMAG
):
821 if (code
== MINUS_EXPR
)
822 ri
= gimplify_build2 (bsi
, MINUS_EXPR
, inner_type
, ai
, bi
);
827 case PAIR (ONLY_IMAG
, ONLY_REAL
):
828 if (code
== MINUS_EXPR
)
829 rr
= gimplify_build2 (bsi
, MINUS_EXPR
, inner_type
, ar
, br
);
835 case PAIR (ONLY_IMAG
, ONLY_IMAG
):
837 ri
= gimplify_build2 (bsi
, code
, inner_type
, ai
, bi
);
840 case PAIR (VARYING
, ONLY_REAL
):
841 rr
= gimplify_build2 (bsi
, code
, inner_type
, ar
, br
);
845 case PAIR (VARYING
, ONLY_IMAG
):
847 ri
= gimplify_build2 (bsi
, code
, inner_type
, ai
, bi
);
850 case PAIR (ONLY_REAL
, VARYING
):
851 if (code
== MINUS_EXPR
)
853 rr
= gimplify_build2 (bsi
, code
, inner_type
, ar
, br
);
857 case PAIR (ONLY_IMAG
, VARYING
):
858 if (code
== MINUS_EXPR
)
861 ri
= gimplify_build2 (bsi
, code
, inner_type
, ai
, bi
);
864 case PAIR (VARYING
, VARYING
):
866 rr
= gimplify_build2 (bsi
, code
, inner_type
, ar
, br
);
867 ri
= gimplify_build2 (bsi
, code
, inner_type
, ai
, bi
);
874 update_complex_assignment (bsi
, rr
, ri
);
877 /* Expand a complex multiplication or division to a libcall to the c99
878 compliant routines. */
881 expand_complex_libcall (block_stmt_iterator
*bsi
, tree ar
, tree ai
,
882 tree br
, tree bi
, enum tree_code code
)
884 enum machine_mode mode
;
885 enum built_in_function bcode
;
886 tree args
, fn
, stmt
, type
;
888 args
= tree_cons (NULL
, bi
, NULL
);
889 args
= tree_cons (NULL
, br
, args
);
890 args
= tree_cons (NULL
, ai
, args
);
891 args
= tree_cons (NULL
, ar
, args
);
893 stmt
= bsi_stmt (*bsi
);
894 type
= TREE_TYPE (TREE_OPERAND (stmt
, 1));
896 mode
= TYPE_MODE (type
);
897 gcc_assert (GET_MODE_CLASS (mode
) == MODE_COMPLEX_FLOAT
);
898 if (code
== MULT_EXPR
)
899 bcode
= BUILT_IN_COMPLEX_MUL_MIN
+ mode
- MIN_MODE_COMPLEX_FLOAT
;
900 else if (code
== RDIV_EXPR
)
901 bcode
= BUILT_IN_COMPLEX_DIV_MIN
+ mode
- MIN_MODE_COMPLEX_FLOAT
;
904 fn
= built_in_decls
[bcode
];
906 TREE_OPERAND (stmt
, 1)
907 = build3 (CALL_EXPR
, type
, build_fold_addr_expr (fn
), args
, NULL
);
912 tree lhs
= TREE_OPERAND (stmt
, 0);
913 type
= TREE_TYPE (type
);
914 update_complex_components (bsi
, stmt
,
915 build1 (REALPART_EXPR
, type
, lhs
),
916 build1 (IMAGPART_EXPR
, type
, lhs
));
920 /* Expand complex multiplication to scalars:
921 a * b = (ar*br - ai*bi) + i(ar*bi + br*ai)
925 expand_complex_multiplication (block_stmt_iterator
*bsi
, tree inner_type
,
926 tree ar
, tree ai
, tree br
, tree bi
,
927 complex_lattice_t al
, complex_lattice_t bl
)
933 complex_lattice_t tl
;
934 rr
= ar
, ar
= br
, br
= rr
;
935 ri
= ai
, ai
= bi
, bi
= ri
;
936 tl
= al
, al
= bl
, bl
= tl
;
939 switch (PAIR (al
, bl
))
941 case PAIR (ONLY_REAL
, ONLY_REAL
):
942 rr
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ar
, br
);
946 case PAIR (ONLY_IMAG
, ONLY_REAL
):
948 if (TREE_CODE (ai
) == REAL_CST
949 && REAL_VALUES_IDENTICAL (TREE_REAL_CST (ai
), dconst1
))
952 ri
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ai
, br
);
955 case PAIR (ONLY_IMAG
, ONLY_IMAG
):
956 rr
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ai
, bi
);
957 rr
= gimplify_build1 (bsi
, NEGATE_EXPR
, inner_type
, rr
);
961 case PAIR (VARYING
, ONLY_REAL
):
962 rr
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ar
, br
);
963 ri
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ai
, br
);
966 case PAIR (VARYING
, ONLY_IMAG
):
967 rr
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ai
, bi
);
968 rr
= gimplify_build1 (bsi
, NEGATE_EXPR
, inner_type
, rr
);
969 ri
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ar
, bi
);
972 case PAIR (VARYING
, VARYING
):
973 if (flag_complex_method
== 2 && SCALAR_FLOAT_TYPE_P (inner_type
))
975 expand_complex_libcall (bsi
, ar
, ai
, br
, bi
, MULT_EXPR
);
982 t1
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ar
, br
);
983 t2
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ai
, bi
);
984 t3
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ar
, bi
);
986 /* Avoid expanding redundant multiplication for the common
987 case of squaring a complex number. */
988 if (ar
== br
&& ai
== bi
)
991 t4
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ai
, br
);
993 rr
= gimplify_build2 (bsi
, MINUS_EXPR
, inner_type
, t1
, t2
);
994 ri
= gimplify_build2 (bsi
, PLUS_EXPR
, inner_type
, t3
, t4
);
1002 update_complex_assignment (bsi
, rr
, ri
);
1005 /* Expand complex division to scalars, straightforward algorithm.
1006 a / b = ((ar*br + ai*bi)/t) + i((ai*br - ar*bi)/t)
1011 expand_complex_div_straight (block_stmt_iterator
*bsi
, tree inner_type
,
1012 tree ar
, tree ai
, tree br
, tree bi
,
1013 enum tree_code code
)
1015 tree rr
, ri
, div
, t1
, t2
, t3
;
1017 t1
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, br
, br
);
1018 t2
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, bi
, bi
);
1019 div
= gimplify_build2 (bsi
, PLUS_EXPR
, inner_type
, t1
, t2
);
1021 t1
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ar
, br
);
1022 t2
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ai
, bi
);
1023 t3
= gimplify_build2 (bsi
, PLUS_EXPR
, inner_type
, t1
, t2
);
1024 rr
= gimplify_build2 (bsi
, code
, inner_type
, t3
, div
);
1026 t1
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ai
, br
);
1027 t2
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ar
, bi
);
1028 t3
= gimplify_build2 (bsi
, MINUS_EXPR
, inner_type
, t1
, t2
);
1029 ri
= gimplify_build2 (bsi
, code
, inner_type
, t3
, div
);
1031 update_complex_assignment (bsi
, rr
, ri
);
1034 /* Expand complex division to scalars, modified algorithm to minimize
1035 overflow with wide input ranges. */
1038 expand_complex_div_wide (block_stmt_iterator
*bsi
, tree inner_type
,
1039 tree ar
, tree ai
, tree br
, tree bi
,
1040 enum tree_code code
)
1042 tree rr
, ri
, ratio
, div
, t1
, t2
, tr
, ti
, cond
;
1043 basic_block bb_cond
, bb_true
, bb_false
, bb_join
;
1045 /* Examine |br| < |bi|, and branch. */
1046 t1
= gimplify_build1 (bsi
, ABS_EXPR
, inner_type
, br
);
1047 t2
= gimplify_build1 (bsi
, ABS_EXPR
, inner_type
, bi
);
1048 cond
= fold_build2 (LT_EXPR
, boolean_type_node
, t1
, t2
);
1051 bb_cond
= bb_true
= bb_false
= bb_join
= NULL
;
1052 rr
= ri
= tr
= ti
= NULL
;
1053 if (!TREE_CONSTANT (cond
))
1057 cond
= build (COND_EXPR
, void_type_node
, cond
, NULL
, NULL
);
1058 bsi_insert_before (bsi
, cond
, BSI_SAME_STMT
);
1060 /* Split the original block, and create the TRUE and FALSE blocks. */
1061 e
= split_block (bsi
->bb
, cond
);
1064 bb_true
= create_empty_bb (bb_cond
);
1065 bb_false
= create_empty_bb (bb_true
);
1067 t1
= build (GOTO_EXPR
, void_type_node
, tree_block_label (bb_true
));
1068 t2
= build (GOTO_EXPR
, void_type_node
, tree_block_label (bb_false
));
1069 COND_EXPR_THEN (cond
) = t1
;
1070 COND_EXPR_ELSE (cond
) = t2
;
1072 /* Wire the blocks together. */
1073 e
->flags
= EDGE_TRUE_VALUE
;
1074 redirect_edge_succ (e
, bb_true
);
1075 make_edge (bb_cond
, bb_false
, EDGE_FALSE_VALUE
);
1076 make_edge (bb_true
, bb_join
, EDGE_FALLTHRU
);
1077 make_edge (bb_false
, bb_join
, EDGE_FALLTHRU
);
1079 /* Update dominance info. Note that bb_join's data was
1080 updated by split_block. */
1081 if (dom_info_available_p (CDI_DOMINATORS
))
1083 set_immediate_dominator (CDI_DOMINATORS
, bb_true
, bb_cond
);
1084 set_immediate_dominator (CDI_DOMINATORS
, bb_false
, bb_cond
);
1087 rr
= make_rename_temp (inner_type
, NULL
);
1088 ri
= make_rename_temp (inner_type
, NULL
);
1091 /* In the TRUE branch, we compute
1093 div = (br * ratio) + bi;
1094 tr = (ar * ratio) + ai;
1095 ti = (ai * ratio) - ar;
1098 if (bb_true
|| integer_nonzerop (cond
))
1102 *bsi
= bsi_last (bb_true
);
1103 bsi_insert_after (bsi
, build_empty_stmt (), BSI_NEW_STMT
);
1106 ratio
= gimplify_build2 (bsi
, code
, inner_type
, br
, bi
);
1108 t1
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, br
, ratio
);
1109 div
= gimplify_build2 (bsi
, PLUS_EXPR
, inner_type
, t1
, bi
);
1111 t1
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ar
, ratio
);
1112 tr
= gimplify_build2 (bsi
, PLUS_EXPR
, inner_type
, t1
, ai
);
1114 t1
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ai
, ratio
);
1115 ti
= gimplify_build2 (bsi
, MINUS_EXPR
, inner_type
, t1
, ar
);
1117 tr
= gimplify_build2 (bsi
, code
, inner_type
, tr
, div
);
1118 ti
= gimplify_build2 (bsi
, code
, inner_type
, ti
, div
);
1122 t1
= build (MODIFY_EXPR
, inner_type
, rr
, tr
);
1123 bsi_insert_before (bsi
, t1
, BSI_SAME_STMT
);
1124 t1
= build (MODIFY_EXPR
, inner_type
, ri
, ti
);
1125 bsi_insert_before (bsi
, t1
, BSI_SAME_STMT
);
1130 /* In the FALSE branch, we compute
1132 divisor = (d * ratio) + c;
1133 tr = (b * ratio) + a;
1134 ti = b - (a * ratio);
1137 if (bb_false
|| integer_zerop (cond
))
1141 *bsi
= bsi_last (bb_false
);
1142 bsi_insert_after (bsi
, build_empty_stmt (), BSI_NEW_STMT
);
1145 ratio
= gimplify_build2 (bsi
, code
, inner_type
, bi
, br
);
1147 t1
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, bi
, ratio
);
1148 div
= gimplify_build2 (bsi
, PLUS_EXPR
, inner_type
, t1
, br
);
1150 t1
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ai
, ratio
);
1151 tr
= gimplify_build2 (bsi
, PLUS_EXPR
, inner_type
, t1
, ar
);
1153 t1
= gimplify_build2 (bsi
, MULT_EXPR
, inner_type
, ar
, ratio
);
1154 ti
= gimplify_build2 (bsi
, MINUS_EXPR
, inner_type
, ai
, t1
);
1156 tr
= gimplify_build2 (bsi
, code
, inner_type
, tr
, div
);
1157 ti
= gimplify_build2 (bsi
, code
, inner_type
, ti
, div
);
1161 t1
= build (MODIFY_EXPR
, inner_type
, rr
, tr
);
1162 bsi_insert_before (bsi
, t1
, BSI_SAME_STMT
);
1163 t1
= build (MODIFY_EXPR
, inner_type
, ri
, ti
);
1164 bsi_insert_before (bsi
, t1
, BSI_SAME_STMT
);
1170 *bsi
= bsi_start (bb_join
);
1174 update_complex_assignment (bsi
, rr
, ri
);
1177 /* Expand complex division to scalars. */
1180 expand_complex_division (block_stmt_iterator
*bsi
, tree inner_type
,
1181 tree ar
, tree ai
, tree br
, tree bi
,
1182 enum tree_code code
,
1183 complex_lattice_t al
, complex_lattice_t bl
)
1187 switch (PAIR (al
, bl
))
1189 case PAIR (ONLY_REAL
, ONLY_REAL
):
1190 rr
= gimplify_build2 (bsi
, code
, inner_type
, ar
, br
);
1194 case PAIR (ONLY_REAL
, ONLY_IMAG
):
1196 ri
= gimplify_build2 (bsi
, code
, inner_type
, ar
, bi
);
1197 ri
= gimplify_build1 (bsi
, NEGATE_EXPR
, inner_type
, ri
);
1200 case PAIR (ONLY_IMAG
, ONLY_REAL
):
1202 ri
= gimplify_build2 (bsi
, code
, inner_type
, ai
, br
);
1205 case PAIR (ONLY_IMAG
, ONLY_IMAG
):
1206 rr
= gimplify_build2 (bsi
, code
, inner_type
, ai
, bi
);
1210 case PAIR (VARYING
, ONLY_REAL
):
1211 rr
= gimplify_build2 (bsi
, code
, inner_type
, ar
, br
);
1212 ri
= gimplify_build2 (bsi
, code
, inner_type
, ai
, br
);
1215 case PAIR (VARYING
, ONLY_IMAG
):
1216 rr
= gimplify_build2 (bsi
, code
, inner_type
, ai
, bi
);
1217 ri
= gimplify_build2 (bsi
, code
, inner_type
, ar
, bi
);
1218 ri
= gimplify_build1 (bsi
, NEGATE_EXPR
, inner_type
, ri
);
1220 case PAIR (ONLY_REAL
, VARYING
):
1221 case PAIR (ONLY_IMAG
, VARYING
):
1222 case PAIR (VARYING
, VARYING
):
1223 switch (flag_complex_method
)
1226 /* straightforward implementation of complex divide acceptable. */
1227 expand_complex_div_straight (bsi
, inner_type
, ar
, ai
, br
, bi
, code
);
1231 if (SCALAR_FLOAT_TYPE_P (inner_type
))
1233 expand_complex_libcall (bsi
, ar
, ai
, br
, bi
, code
);
1239 /* wide ranges of inputs must work for complex divide. */
1240 expand_complex_div_wide (bsi
, inner_type
, ar
, ai
, br
, bi
, code
);
1252 update_complex_assignment (bsi
, rr
, ri
);
1255 /* Expand complex negation to scalars:
1260 expand_complex_negation (block_stmt_iterator
*bsi
, tree inner_type
,
1265 rr
= gimplify_build1 (bsi
, NEGATE_EXPR
, inner_type
, ar
);
1266 ri
= gimplify_build1 (bsi
, NEGATE_EXPR
, inner_type
, ai
);
1268 update_complex_assignment (bsi
, rr
, ri
);
1271 /* Expand complex conjugate to scalars:
1276 expand_complex_conjugate (block_stmt_iterator
*bsi
, tree inner_type
,
1281 ri
= gimplify_build1 (bsi
, NEGATE_EXPR
, inner_type
, ai
);
1283 update_complex_assignment (bsi
, ar
, ri
);
1286 /* Expand complex comparison (EQ or NE only). */
1289 expand_complex_comparison (block_stmt_iterator
*bsi
, tree ar
, tree ai
,
1290 tree br
, tree bi
, enum tree_code code
)
1292 tree cr
, ci
, cc
, stmt
, expr
, type
;
1294 cr
= gimplify_build2 (bsi
, code
, boolean_type_node
, ar
, br
);
1295 ci
= gimplify_build2 (bsi
, code
, boolean_type_node
, ai
, bi
);
1296 cc
= gimplify_build2 (bsi
,
1297 (code
== EQ_EXPR
? TRUTH_AND_EXPR
: TRUTH_OR_EXPR
),
1298 boolean_type_node
, cr
, ci
);
1300 stmt
= expr
= bsi_stmt (*bsi
);
1302 switch (TREE_CODE (stmt
))
1305 expr
= TREE_OPERAND (stmt
, 0);
1308 type
= TREE_TYPE (TREE_OPERAND (expr
, 1));
1309 TREE_OPERAND (expr
, 1) = fold_convert (type
, cc
);
1312 TREE_OPERAND (stmt
, 0) = cc
;
1321 /* Process one statement. If we identify a complex operation, expand it. */
1324 expand_complex_operations_1 (block_stmt_iterator
*bsi
)
1326 tree stmt
= bsi_stmt (*bsi
);
1327 tree rhs
, type
, inner_type
;
1328 tree ac
, ar
, ai
, bc
, br
, bi
;
1329 complex_lattice_t al
, bl
;
1330 enum tree_code code
;
1332 switch (TREE_CODE (stmt
))
1335 stmt
= TREE_OPERAND (stmt
, 0);
1338 if (TREE_CODE (stmt
) != MODIFY_EXPR
)
1343 rhs
= TREE_OPERAND (stmt
, 1);
1347 rhs
= TREE_OPERAND (stmt
, 0);
1354 type
= TREE_TYPE (rhs
);
1355 code
= TREE_CODE (rhs
);
1357 /* Initial filter for operations we handle. */
1363 case TRUNC_DIV_EXPR
:
1365 case FLOOR_DIV_EXPR
:
1366 case ROUND_DIV_EXPR
:
1370 if (TREE_CODE (type
) != COMPLEX_TYPE
)
1372 inner_type
= TREE_TYPE (type
);
1377 inner_type
= TREE_TYPE (TREE_OPERAND (rhs
, 1));
1378 if (TREE_CODE (inner_type
) != COMPLEX_TYPE
)
1384 tree lhs
= TREE_OPERAND (stmt
, 0);
1385 tree rhs
= TREE_OPERAND (stmt
, 1);
1387 if (TREE_CODE (type
) == COMPLEX_TYPE
)
1388 expand_complex_move (bsi
, stmt
, type
, lhs
, rhs
);
1389 else if ((TREE_CODE (rhs
) == REALPART_EXPR
1390 || TREE_CODE (rhs
) == IMAGPART_EXPR
)
1391 && TREE_CODE (TREE_OPERAND (rhs
, 0)) == SSA_NAME
)
1393 TREE_OPERAND (stmt
, 1)
1394 = extract_component (bsi
, TREE_OPERAND (rhs
, 0),
1395 TREE_CODE (rhs
) == IMAGPART_EXPR
, false);
1402 /* Extract the components of the two complex values. Make sure and
1403 handle the common case of the same value used twice specially. */
1404 ac
= TREE_OPERAND (rhs
, 0);
1405 ar
= extract_component (bsi
, ac
, 0, true);
1406 ai
= extract_component (bsi
, ac
, 1, true);
1408 if (TREE_CODE_CLASS (code
) == tcc_unary
)
1409 bc
= br
= bi
= NULL
;
1412 bc
= TREE_OPERAND (rhs
, 1);
1417 br
= extract_component (bsi
, bc
, 0, true);
1418 bi
= extract_component (bsi
, bc
, 1, true);
1424 al
= find_lattice_value (ac
);
1425 if (al
== UNINITIALIZED
)
1428 if (TREE_CODE_CLASS (code
) == tcc_unary
)
1434 bl
= find_lattice_value (bc
);
1435 if (bl
== UNINITIALIZED
)
1446 expand_complex_addition (bsi
, inner_type
, ar
, ai
, br
, bi
, code
, al
, bl
);
1450 expand_complex_multiplication (bsi
, inner_type
, ar
, ai
, br
, bi
, al
, bl
);
1453 case TRUNC_DIV_EXPR
:
1455 case FLOOR_DIV_EXPR
:
1456 case ROUND_DIV_EXPR
:
1458 expand_complex_division (bsi
, inner_type
, ar
, ai
, br
, bi
, code
, al
, bl
);
1462 expand_complex_negation (bsi
, inner_type
, ar
, ai
);
1466 expand_complex_conjugate (bsi
, inner_type
, ar
, ai
);
1471 expand_complex_comparison (bsi
, ar
, ai
, br
, bi
, code
);
1480 /* Entry point for complex operation lowering during optimization. */
1483 tree_lower_complex (void)
1485 int old_last_basic_block
;
1486 block_stmt_iterator bsi
;
1489 if (!init_dont_simulate_again ())
1492 complex_lattice_values
= VEC_alloc (complex_lattice_t
, heap
, num_ssa_names
);
1493 VEC_safe_grow (complex_lattice_t
, heap
,
1494 complex_lattice_values
, num_ssa_names
);
1495 memset (VEC_address (complex_lattice_t
, complex_lattice_values
), 0,
1496 num_ssa_names
* sizeof(complex_lattice_t
));
1498 init_parameter_lattice_values ();
1499 ssa_propagate (complex_visit_stmt
, complex_visit_phi
);
1501 complex_variable_components
= htab_create (10, int_tree_map_hash
,
1502 int_tree_map_eq
, free
);
1504 complex_ssa_name_components
= VEC_alloc (tree
, heap
, 2*num_ssa_names
);
1505 VEC_safe_grow (tree
, heap
, complex_ssa_name_components
, 2*num_ssa_names
);
1506 memset (VEC_address (tree
, complex_ssa_name_components
), 0,
1507 2 * num_ssa_names
* sizeof(tree
));
1509 update_parameter_components ();
1511 /* ??? Ideally we'd traverse the blocks in breadth-first order. */
1512 old_last_basic_block
= last_basic_block
;
1515 if (bb
->index
>= old_last_basic_block
)
1517 update_phi_components (bb
);
1518 for (bsi
= bsi_start (bb
); !bsi_end_p (bsi
); bsi_next (&bsi
))
1519 expand_complex_operations_1 (&bsi
);
1522 bsi_commit_edge_inserts ();
1524 htab_delete (complex_variable_components
);
1525 VEC_free (tree
, heap
, complex_ssa_name_components
);
1526 VEC_free (complex_lattice_t
, heap
, complex_lattice_values
);
1529 struct tree_opt_pass pass_lower_complex
=
1531 "cplxlower", /* name */
1533 tree_lower_complex
, /* execute */
1536 0, /* static_pass_number */
1538 PROP_ssa
, /* properties_required */
1539 0, /* properties_provided */
1540 0, /* properties_destroyed */
1541 0, /* todo_flags_start */
1542 TODO_dump_func
| TODO_ggc_collect
1544 | TODO_verify_stmts
, /* todo_flags_finish */
1549 /* Entry point for complex operation lowering without optimization. */
1552 tree_lower_complex_O0 (void)
1554 int old_last_basic_block
= last_basic_block
;
1555 block_stmt_iterator bsi
;
1560 if (bb
->index
>= old_last_basic_block
)
1562 for (bsi
= bsi_start (bb
); !bsi_end_p (bsi
); bsi_next (&bsi
))
1563 expand_complex_operations_1 (&bsi
);
1568 gate_no_optimization (void)
1570 /* With errors, normal optimization passes are not run. If we don't
1571 lower complex operations at all, rtl expansion will abort. */
1572 return optimize
== 0 || sorrycount
|| errorcount
;
1575 struct tree_opt_pass pass_lower_complex_O0
=
1577 "cplxlower0", /* name */
1578 gate_no_optimization
, /* gate */
1579 tree_lower_complex_O0
, /* execute */
1582 0, /* static_pass_number */
1584 PROP_cfg
, /* properties_required */
1585 0, /* properties_provided */
1586 0, /* properties_destroyed */
1587 0, /* todo_flags_start */
1588 TODO_dump_func
| TODO_ggc_collect
1589 | TODO_verify_stmts
, /* todo_flags_finish */