C++: Add comment as suggested in the PR review for #14708.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-11-07 15:16:38 +00:00
parent 2787f0a0fc
commit 1c8f474848

View File

@@ -134,6 +134,12 @@ void test_div(int x) {
struct X { int n; };
void read_argument(const X *);
// This test exists purely to ensure that modulus analysis terminates in the
// presence of inexact phi operands. The LoadInstruction on `while(x->n) { ... }`
// reads from a PhiInstruction with two input operands: an exact operand defined
// by the StoreInstruction generated by `x->n--` and an inexact operand coming
// from the WriteSideEffect generated by `read_argument(x)`. If we don't consider
// the inexact operand modulus analysis fails to terminate.
void nonterminating_without_operands_as_ssa(X *x) {
read_argument(x);
while (x->n) {