I searched on gcc bugzilla and found this bug report :
Althoug the report is about gcc 4.8 and I’m using 4.7, I tried the proposed workaround and it works !
Compiling with -fvar-tracking
allows GDB to print the correct value for b after assignment.