From: Kyrylo Tkachov Date: Tue, 1 Oct 2019 10:33:40 +0000 (+0000) Subject: [AArch64] Don't split 64-bit constant stores to volatile location X-Git-Tag: releases/gcc-9.3.0~588 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1144493ff5604d53c6494258d1a62684738c0a0e;p=thirdparty%2Fgcc.git [AArch64] Don't split 64-bit constant stores to volatile location 2019-10-01 Kyrylo Tkachov Backport from mainline 2019-09-24 Kyrylo Tkachov * config/aarch64/aarch64.md (mov): Don't call aarch64_split_dimode_const_store on volatile MEM. * gcc.target/aarch64/nosplit-di-const-volatile_1.c: New test. From-SVN: r276398 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5f1145ef8d4a..182d2e28b9e7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-10-01 Kyrylo Tkachov + + Backport from mainline + 2019-09-24 Kyrylo Tkachov + + * config/aarch64/aarch64.md (mov): Don't call + aarch64_split_dimode_const_store on volatile MEM. + 2019-10-01 Kyrylo Tkachov Backport from mainline diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index f08cd0930b3f..cc5a887d4049 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -1059,8 +1059,8 @@ (match_operand:GPI 1 "general_operand" ""))] "" " - if (MEM_P (operands[0]) && CONST_INT_P (operands[1]) - && mode == DImode + if (MEM_P (operands[0]) && !MEM_VOLATILE_P (operands[0]) + && CONST_INT_P (operands[1]) && mode == DImode && aarch64_split_dimode_const_store (operands[0], operands[1])) DONE; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 71b6ec52fcd4..5cf8feb32a52 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2019-10-01 Kyrylo Tkachov + + Backport from mainline + 2019-09-24 Kyrylo Tkachov + + * gcc.target/aarch64/nosplit-di-const-volatile_1.c: New test. + 2019-09-25 Kyrylo Tkachov Backport from mainline diff --git a/gcc/testsuite/gcc.target/aarch64/nosplit-di-const-volatile_1.c b/gcc/testsuite/gcc.target/aarch64/nosplit-di-const-volatile_1.c new file mode 100644 index 000000000000..da5975ad1652 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/nosplit-di-const-volatile_1.c @@ -0,0 +1,15 @@ +/* Check that storing the 64-bit immediate to a volatile location is done + with a single store. */ + +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef unsigned long long u64; + +void bar (u64 *x) +{ + *(volatile u64 *)x = 0xabcdef10abcdef10ULL; +} + +/* { dg-final { scan-assembler-times "str\tx..?, .*" 1 } } */ +/* { dg-final { scan-assembler-not "str\tw..?, .*" } } */