It fails to compile due to an lvalue cast. Attached is the upstream patch that fixes this issue. If there are no objections, I'd like to apply it.
Created attachment 55733 [details, diff] GCC4 compile fix
added to portage