Use more conservative fences on RISC-V
authorPalmer Dabbelt <palmer@dabbelt.com>
Mon, 20 Mar 2017 16:43:17 +0000 (16:43 +0000)
committerPalmer Dabbelt <palmer@gcc.gnu.org>
Mon, 20 Mar 2017 16:43:17 +0000 (16:43 +0000)
commite05a9f8e560a09d920555dec2960497dcb9e9ede
tree385a82b5b6098b1d4c2307ccaf95431cb066bbc2
parent3611534e1f90fc05f363cc7b40d45fcd295c26ad
Use more conservative fences on RISC-V

The RISC-V memory model is still in the process of being formally
specified, so for now we're going to be safe and add the I/O bits to
userspace fences because there's no way to know if userspace is touching
memory-mapped I/O regions at compile time.

This will have no impact on existing microarchitecutres because they
treat all fences conservatively.

gcc/ChangeLog:

2017-03-17  Palmer Dabbelt  <palmer@dabbelt.com>

        * config/riscv/riscv.c (riscv_print_operand): Use "fence
        iorw,ow".
        * config/riscv/sync.mc (mem_thread_fence_1): Use "fence
        iorw,iorw".

From-SVN: r246282
gcc/ChangeLog
gcc/config/riscv/riscv.c
gcc/config/riscv/sync.md