- } else if (op == op_Confirm) {
- if (get_Confirm_cmp(n) == pn_Cmp_Lg &&
- classify_Const(get_Confirm_bound(n)) == CNST_NULL) {
- *confirm = n;
- return 1;
+ } else {
+ for (; is_Confirm(n); n = skip_Cast(get_Confirm_value(n))) {
+ unsigned long region = get_Confirm_region(n);
+
+ /* check if it's legal to use this confirm. */
+ if (region != 0) {
+ ir_node *curr_blk = get_irn_n(n, -1);
+
+ /* this confirm is bound to a region. */
+ if (! blk)
+ continue;
+
+ if (get_Block_exc_region(curr_blk) != region)
+ continue;
+ /* all went fine, the current Confirm belongs to the same region */
+ }
+
+ if (get_Confirm_cmp(n) == pn_Cmp_Lg &&
+ classify_Const(get_Confirm_bound(n)) == CNST_NULL) {
+ *confirm = n;
+ return 1;
+ }