- case COND_EXPR:
- {
- rtx label1 = gen_label_rtx ();
- if (!if_true_label || !if_false_label)
- {
- drop_through_label = gen_label_rtx ();
- if (!if_true_label)
- if_true_label = drop_through_label;
- if (!if_false_label)
- if_false_label = drop_through_label;
- }
-
- do_pending_stack_adjust ();
- do_jump (TREE_OPERAND (exp, 0), label1, NULL_RTX);
- do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label);
- emit_label (label1);
- do_jump (TREE_OPERAND (exp, 2), if_false_label, if_true_label);
- break;
- }
-
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
- case COMPOUND_EXPR:
- /* Lowered by gimplify.c. */
- gcc_unreachable ();
-
- case COMPONENT_REF:
- case BIT_FIELD_REF:
- case ARRAY_REF:
- case ARRAY_RANGE_REF:
- {
- HOST_WIDE_INT bitsize, bitpos;
- int unsignedp;
- enum machine_mode mode;
- tree type;
- tree offset;
- int volatilep = 0;
-
- /* Get description of this reference. We don't actually care
- about the underlying object here. */
- get_inner_reference (exp, &bitsize, &bitpos, &offset, &mode,
- &unsignedp, &volatilep, false);
-
- type = lang_hooks.types.type_for_size (bitsize, unsignedp);
- if (! SLOW_BYTE_ACCESS
- && type != 0 && bitsize >= 0
- && TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (exp))
- && (cmp_optab->handlers[(int) TYPE_MODE (type)].insn_code
- != CODE_FOR_nothing))
- {
- do_jump (convert (type, exp), if_false_label, if_true_label);
- break;
- }
- goto normal;
- }
-
- case EQ_EXPR:
- {
- tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
-
- gcc_assert (GET_MODE_CLASS (TYPE_MODE (inner_type))
- != MODE_COMPLEX_FLOAT);
- gcc_assert (GET_MODE_CLASS (TYPE_MODE (inner_type))
- != MODE_COMPLEX_INT);
-
- if (integer_zerop (TREE_OPERAND (exp, 1)))
- do_jump (TREE_OPERAND (exp, 0), if_true_label, if_false_label);
- else if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_INT
- && !can_compare_p (EQ, TYPE_MODE (inner_type), ccp_jump))
- do_jump_by_parts_equality (exp, if_false_label, if_true_label);
- else
- do_compare_and_jump (exp, EQ, EQ, if_false_label, if_true_label);
- break;
- }
-
- case NE_EXPR:
- {
- tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
-
- gcc_assert (GET_MODE_CLASS (TYPE_MODE (inner_type))
- != MODE_COMPLEX_FLOAT);
- gcc_assert (GET_MODE_CLASS (TYPE_MODE (inner_type))
- != MODE_COMPLEX_INT);
-
- if (integer_zerop (TREE_OPERAND (exp, 1)))
- do_jump (TREE_OPERAND (exp, 0), if_false_label, if_true_label);
- else if (GET_MODE_CLASS (TYPE_MODE (inner_type)) == MODE_INT
- && !can_compare_p (NE, TYPE_MODE (inner_type), ccp_jump))
- do_jump_by_parts_equality (exp, if_true_label, if_false_label);
- else
- do_compare_and_jump (exp, NE, NE, if_false_label, if_true_label);
- break;
- }
-
- case LT_EXPR:
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- if (GET_MODE_CLASS (mode) == MODE_INT
- && ! can_compare_p (LT, mode, ccp_jump))
- do_jump_by_parts_greater (exp, 1, if_false_label, if_true_label);
- else
- do_compare_and_jump (exp, LT, LTU, if_false_label, if_true_label);
- break;
-
- case LE_EXPR:
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- if (GET_MODE_CLASS (mode) == MODE_INT
- && ! can_compare_p (LE, mode, ccp_jump))
- do_jump_by_parts_greater (exp, 0, if_true_label, if_false_label);
- else
- do_compare_and_jump (exp, LE, LEU, if_false_label, if_true_label);
- break;
-
- case GT_EXPR:
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- if (GET_MODE_CLASS (mode) == MODE_INT
- && ! can_compare_p (GT, mode, ccp_jump))
- do_jump_by_parts_greater (exp, 0, if_false_label, if_true_label);
- else
- do_compare_and_jump (exp, GT, GTU, if_false_label, if_true_label);
- break;
-
- case GE_EXPR:
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- if (GET_MODE_CLASS (mode) == MODE_INT
- && ! can_compare_p (GE, mode, ccp_jump))
- do_jump_by_parts_greater (exp, 1, if_true_label, if_false_label);
- else
- do_compare_and_jump (exp, GE, GEU, if_false_label, if_true_label);
- break;
-
- case UNORDERED_EXPR:
- case ORDERED_EXPR:
- {
- enum rtx_code cmp, rcmp;
- int do_rev;
-
- if (code == UNORDERED_EXPR)
- cmp = UNORDERED, rcmp = ORDERED;
- else
- cmp = ORDERED, rcmp = UNORDERED;
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
-
- do_rev = 0;
- if (! can_compare_p (cmp, mode, ccp_jump)
- && (can_compare_p (rcmp, mode, ccp_jump)
- /* If the target doesn't provide either UNORDERED or ORDERED
- comparisons, canonicalize on UNORDERED for the library. */
- || rcmp == UNORDERED))
- do_rev = 1;
-
- if (! do_rev)
- do_compare_and_jump (exp, cmp, cmp, if_false_label, if_true_label);
- else
- do_compare_and_jump (exp, rcmp, rcmp, if_true_label, if_false_label);
- }
- break;
-
- {
- enum rtx_code rcode1;
- enum tree_code tcode1, tcode2;
-
- case UNLT_EXPR:
- rcode1 = UNLT;
- tcode1 = UNORDERED_EXPR;
- tcode2 = LT_EXPR;
- goto unordered_bcc;
- case UNLE_EXPR:
- rcode1 = UNLE;
- tcode1 = UNORDERED_EXPR;
- tcode2 = LE_EXPR;
- goto unordered_bcc;
- case UNGT_EXPR:
- rcode1 = UNGT;
- tcode1 = UNORDERED_EXPR;
- tcode2 = GT_EXPR;
- goto unordered_bcc;
- case UNGE_EXPR:
- rcode1 = UNGE;
- tcode1 = UNORDERED_EXPR;
- tcode2 = GE_EXPR;
- goto unordered_bcc;
- case UNEQ_EXPR:
- rcode1 = UNEQ;
- tcode1 = UNORDERED_EXPR;
- tcode2 = EQ_EXPR;
- goto unordered_bcc;
- case LTGT_EXPR:
- /* It is ok for LTGT_EXPR to trap when the result is unordered,
- so expand to (a < b) || (a > b). */
- rcode1 = LTGT;
- tcode1 = LT_EXPR;
- tcode2 = GT_EXPR;
- goto unordered_bcc;
-
- unordered_bcc:
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- if (can_compare_p (rcode1, mode, ccp_jump))
- do_compare_and_jump (exp, rcode1, rcode1, if_false_label,
- if_true_label);
- else
- {
- tree op0 = save_expr (TREE_OPERAND (exp, 0));
- tree op1 = save_expr (TREE_OPERAND (exp, 1));
- tree cmp0, cmp1;
-
- /* If the target doesn't support combined unordered
- compares, decompose into two comparisons. */
- if (if_true_label == 0)
- drop_through_label = if_true_label = gen_label_rtx ();
-
- cmp0 = fold (build2 (tcode1, TREE_TYPE (exp), op0, op1));
- cmp1 = fold (build2 (tcode2, TREE_TYPE (exp), op0, op1));
- do_jump (cmp0, 0, if_true_label);
- do_jump (cmp1, if_false_label, if_true_label);
- }
- }
- break;
-
- /* Special case:
- __builtin_expect (<test>, 0) and
- __builtin_expect (<test>, 1)
-
- We need to do this here, so that <test> is not converted to a SCC
- operation on machines that use condition code registers and COMPARE
- like the PowerPC, and then the jump is done based on whether the SCC
- operation produced a 1 or 0. */
- case CALL_EXPR:
- /* Check for a built-in function. */
- {
- tree fndecl = get_callee_fndecl (exp);
- tree arglist = TREE_OPERAND (exp, 1);
-
- if (fndecl
- && DECL_BUILT_IN (fndecl)
- && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT
- && arglist != NULL_TREE
- && TREE_CHAIN (arglist) != NULL_TREE)
- {
- rtx seq = expand_builtin_expect_jump (exp, if_false_label,
- if_true_label);
-
- if (seq != NULL_RTX)
- {
- emit_insn (seq);
- return;
- }
- }
- }