From 9d869180c4adba42d68c14dab51fba8093ccf91c Mon Sep 17 00:00:00 2001 From: Diogo Sampaio Date: Fri, 7 Feb 2020 10:03:59 +0000 Subject: [ARM] Follow AACPS for preserving number of loads/stores of volatile bit-fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Following the AAPCS, every store to a volatile bit-field requires to generate one load of that field, even if all the bits are going to be replaced. This patch allows the user to opt-in in following such rule, whenever the a. AAPCS Release 2019Q1.1 (https://static.docs.arm.com/ihi0042/g/aapcs32.pdf) section 8.1 Data Types, page 35, paragraph: Volatile bit-fields – preserving number and width of container accesses ``` When a volatile bit-field is written, and its container does not overlap with any non-bit-field member, its container must be read exactly once and written exactly once using the access width appropriate to the type of the container. The two accesses are not atomic. ``` Reviewers: lebedev.ri, ostannard, jfb, eli.friedman Reviewed By: jfb Subscribers: rsmith, rjmccall, dexonsmith, kristof.beyls, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67399 --- clang/lib/Frontend/CompilerInvocation.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index eb30a19..463b265 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1439,6 +1439,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.SymbolPartition = std::string(Args.getLastArgValue(OPT_fsymbol_partition_EQ)); + Opts.ForceAAPCSBitfieldLoad = Args.hasArg(OPT_ForceAAPCSBitfieldLoad); return Success; } -- cgit v1.1