[arm] Applied patch from Richard Dunkley <rick.dunkley@gmail.com>. Fix complication problems with newer gcc versions. Fixes #24588.