Fix build with Clang 6.0.
Note it is partially merged from the upstream patches for Linux and GCC 6.
https://bugs.openjdk.java.net/browse/JDK-8163032
http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot/rev/e34324d73cd5
http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/rev/9e1264f51bae
PR: 225054