[gcc(refs/vendors/ARM/heads/morello)] Put braces around MOVE_RATIO aarch64 macro

Matthew Malcomson matmal01@gcc.gnu.org
Mon Sep 11 17:25:24 GMT 2023


https://gcc.gnu.org/g:c74351eb79ab309a10c6d61ac5fe800e0cb479c3

commit c74351eb79ab309a10c6d61ac5fe800e0cb479c3
Author: Matthew Malcomson <matthew.malcomson@arm.com>
Date:   Mon Sep 11 16:17:45 2023 +0100

    Put braces around MOVE_RATIO aarch64 macro
    
    We had earlier made our MOVE_RATIO macro return zero for MORELLO
    targets.  This is so we can disable the move-by-pieces infrastructure
    on memory which could contain capabilities.  Block moving of data which
    could contain capabilities needs to avoid invalidating said
    capabilities, and we have not adjusted this infrastructure to do so.
    
    The macro we had was not parenthesised.  While adding some loop
    optimisations to the compiler with capabilities I noticed that the
    testcase new17.C was failing.  It turns out that this was because this
    MOVE_RATIO macro was interacting with surrounding code in
    `estimate_num_insns` in an unintended manner.  With added braces around
    the macro the test now passes for capabilities.

Diff:
---
 gcc/config/aarch64/aarch64.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index 635f1cc0eca9..cb68286036c6 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -1126,8 +1126,8 @@ typedef struct
    targeting -mstrict-align, so keep a sensible default in that case.
    Disable this for ccapability-enabled architectures to avoid invalidating a
    capability due to a move_by_pieces operation.   */
-#define MOVE_RATIO(speed) TARGET_MORELLO ? 0 : \
-  (!STRICT_ALIGNMENT ? 2 : (((speed) ? 15 : AARCH64_CALL_RATIO) / 2))
+#define MOVE_RATIO(speed) (TARGET_MORELLO ? 0 : \
+  (!STRICT_ALIGNMENT ? 2 : (((speed) ? 15 : AARCH64_CALL_RATIO) / 2)))
 
 /* For CLEAR_RATIO, when optimizing for size, give a better estimate
    of the length of a memset call, but use the default otherwise.  */


More information about the Gcc-cvs mailing list