+ /* In the TRUE branch, we compute
+ ratio = br/bi;
+ div = (br * ratio) + bi;
+ tr = (ar * ratio) + ai;
+ ti = (ai * ratio) - ar;
+ tr = tr / div;
+ ti = ti / div; */
+ if (bb_true || integer_nonzerop (cond))
+ {
+ if (bb_true)
+ {
+ *bsi = bsi_last (bb_true);
+ bsi_insert_after (bsi, build_empty_stmt (), BSI_NEW_STMT);
+ }
+
+ ratio = gimplify_build2 (bsi, code, inner_type, br, bi);
+
+ t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, br, ratio);
+ div = gimplify_build2 (bsi, PLUS_EXPR, inner_type, t1, bi);
+
+ t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, ratio);
+ tr = gimplify_build2 (bsi, PLUS_EXPR, inner_type, t1, ai);
+
+ t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, ratio);
+ ti = gimplify_build2 (bsi, MINUS_EXPR, inner_type, t1, ar);
+
+ tr = gimplify_build2 (bsi, code, inner_type, tr, div);
+ ti = gimplify_build2 (bsi, code, inner_type, ti, div);
+
+ if (bb_true)
+ {
+ t1 = build (MODIFY_EXPR, inner_type, rr, tr);
+ bsi_insert_before (bsi, t1, BSI_SAME_STMT);
+ t1 = build (MODIFY_EXPR, inner_type, ri, ti);
+ bsi_insert_before (bsi, t1, BSI_SAME_STMT);
+ bsi_remove (bsi);
+ }
+ }
+
+ /* In the FALSE branch, we compute
+ ratio = d/c;
+ divisor = (d * ratio) + c;
+ tr = (b * ratio) + a;
+ ti = b - (a * ratio);
+ tr = tr / div;
+ ti = ti / div; */
+ if (bb_false || integer_zerop (cond))
+ {
+ if (bb_false)
+ {
+ *bsi = bsi_last (bb_false);
+ bsi_insert_after (bsi, build_empty_stmt (), BSI_NEW_STMT);
+ }
+
+ ratio = gimplify_build2 (bsi, code, inner_type, bi, br);