Of course and this is what actually happens if you enable overflow checking but it comes at a price - if your code is correct you will never need the checks but you will execute them every time.
here's the best guide i could find on enabling those checks in gcc.
it is unclear whether they take advantage of the carry bits, do you have a source for that information?
You can see the implementation in GCC here [1], for example addition starting on line 74. What machine code gets emitted for that obviously depends on the target architecture but it is reasonable to assume that the optimizer recognizes these patterns and uses hardware flags where available.
From the code you posted, and the assembly[1] emitted in the pdf above I can't see the optimiser taking advantage of the carry bit. No mention of CF, OF:
[1]
lea ebx, DWORD PTR [edi+eax]
cmp ebx, edi
jae SHORT $LN4@unsigned_c
cmp ebx, eax
jae SHORT $LN4@unsigned_c
mov ecx, 1
jmp SHORT $LN5@unsigned_c
xor ecx, ecx
The gcc flag ftapv only works for signed integers, not clear what the carry bit behaviour is for unsigned integers.