RFR: 8313141: Remove discarded volatile qualifier in assembler_aarch64.hpp [v3]

Andrew Haley aph at openjdk.org
Fri Jul 28 09:40:51 UTC 2023


On Fri, 28 Jul 2023 03:33:22 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> ISO C++ asm is always implicitly volatile, as per https://gcc.gnu.org/onlinedocs/gcc/Basic-Asm.html, and all volatile qualifiers are always ignored if GNU asm was never used
>
> Julian Waters has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - assembler_aarch64.hpp
>  - src/hotspot/cpu/aarch64/assembler_aarch64.hpp
>    
>    Co-authored-by: Andrew Haley <aph-open at littlepinkcloud.com>

What is gained by this change? 

You've removed a volatile qualifier, which does no harm but indicates that an asm must be retained, and added a comment to that effect. The volatile qualifier doesn't have any affect because the compiler would have retained it anyway.

If I may use an analogy, using volatile in this context is like using a left-turn signal when in a left-turning lane. It doesn't do much good because you have to turn left from this lane, but it doesn't do any harm either. Many people always signal anyway.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15031#issuecomment-1655382577


More information about the hotspot-compiler-dev mailing list