On Thu May 18 20:30:01 2023 +0000, Giovanni Mascellani wrote:
I think that what we want is:
dst->value.u[k].i = src->value.u[k].i == INT_MIN ? INT_MIN : abs(src->value.u[k].i);
If I'm understanding correctly, the folding pass makes a temporary node that the fold functions write into - the fold function can either successfully inline an op into a constant that can replace the op node, or it can't and the temporary node is discarded, leaving the original node list alone.
It sounds like the intended change to the current revision is to always assign the full constant value even if it turns out to be invalid - that is, the caller can either listen to the return value and discard the dst node, or use it at their own risk... does that make sense?