| ... | ... | @@ -9504,6 +9504,10 @@ static TypeTableEntry *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp |
| 9504 | 9504 | TypeTableEntry *resolved_type = ir_resolve_peer_types(ira, bin_op_instruction->base.source_node, instructions, 2); |
| 9505 | 9505 | if (type_is_invalid(resolved_type)) |
| 9506 | 9506 | return resolved_type; |
| 9507 | type_ensure_zero_bits_known(ira->codegen, resolved_type); |
| 9508 | if (type_is_invalid(resolved_type)) |
| 9509 | return resolved_type; |
| 9510 | |
| 9507 | 9511 | |
| 9508 | 9512 | AstNode *source_node = bin_op_instruction->base.source_node; |
| 9509 | 9513 | switch (resolved_type->id) { |
| ... | ... | @@ -9568,7 +9572,8 @@ static TypeTableEntry *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp |
| 9568 | 9572 | |
| 9569 | 9573 | ConstExprValue *op1_val = &casted_op1->value; |
| 9570 | 9574 | ConstExprValue *op2_val = &casted_op2->value; |
| 9571 | | if ((value_is_comptime(op1_val) && value_is_comptime(op2_val)) || resolved_type->id == TypeTableEntryIdVoid) { |
| 9575 | bool one_possible_value = !type_requires_comptime(resolved_type) && !type_has_bits(resolved_type); |
| 9576 | if (one_possible_value || (value_is_comptime(op1_val) && value_is_comptime(op2_val))) { |
| 9572 | 9577 | bool answer; |
| 9573 | 9578 | if (resolved_type->id == TypeTableEntryIdNumLitFloat || resolved_type->id == TypeTableEntryIdFloat) { |
| 9574 | 9579 | Cmp cmp_result = float_cmp(op1_val, op2_val); |
| ... | ... | @@ -9577,7 +9582,7 @@ static TypeTableEntry *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp |
| 9577 | 9582 | Cmp cmp_result = bigint_cmp(&op1_val->data.x_bigint, &op2_val->data.x_bigint); |
| 9578 | 9583 | answer = resolve_cmp_op_id(op_id, cmp_result); |
| 9579 | 9584 | } else { |
| 9580 | | bool are_equal = resolved_type->id == TypeTableEntryIdVoid || const_values_equal(op1_val, op2_val); |
| 9585 | bool are_equal = one_possible_value || const_values_equal(op1_val, op2_val); |
| 9581 | 9586 | if (op_id == IrBinOpCmpEq) { |
| 9582 | 9587 | answer = are_equal; |
| 9583 | 9588 | } else if (op_id == IrBinOpCmpNotEq) { |