This is the correct fix, however, if you are going to lie to the middle end about TYPE_SIZE so that the TYPE_SIZE and DECL_SIZE do not match.
If we always require that DECL_SIZE be identical to TYPE_SIZE, why have a DECL_SIZE in the first place? But how else would you support bitfields of (e.g.) type "integer".