4 ms·
This jumped out at me too. GCC's documentation says: Data prefetch does not generate faults if addr is invalid, but the address expression itself must be vali
by jzwinck 13y ago
This jumped out at me too. GCC's documentation says:
Data prefetch does not generate faults if addr is invalid, but the address expression itself must be valid. For example, a prefetch of p->next does not fault if p->next is not a valid address, but evaluation faults if p is not a valid address.
This seems to make the code as presented incorrect (i.e. it results in undefined behavior).