00:04mareko: "1 << 31" is undefined, but if it produces INT32_MIN, then (uint64_t)INT32_MIN = 0xffffffff80000000 is correct according to the C standard, which behaves like i2i64 in NIR, but C doesn't say that it should be "sign extension and bitcast": it says that negative numbers are converted to unsigned by repeatedly adding the maximum unsigned value to it until the value is in range, as said in C23 working draft
00:04mareko: N3220, §6.3.1.3 paragraph 2, resulting in the same value 0xffffffff80000000
00:05mareko: one more than the maximum value, actually
00:26karolherbst: yeah it's implementation defined behavior in gcc prior C23