summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/2012-03-16-StoreAlign.cpp
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2015-07-10 11:31:43 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2015-07-10 11:31:43 +0000
commit6e2cea6f0c832f6c017b7e51e3e35edadf57b5d7 (patch)
treee82ea07868cffcc4beffbce9e732397173dea21c /clang/test/CodeGenCXX/2012-03-16-StoreAlign.cpp
parentda33d80e9a25b59b4f382b8a4589fb1c3c6d5e50 (diff)
downloadbcm5719-llvm-6e2cea6f0c832f6c017b7e51e3e35edadf57b5d7.tar.gz
bcm5719-llvm-6e2cea6f0c832f6c017b7e51e3e35edadf57b5d7.zip
Respect alignment when loading up a coerced function argument
Code in CGCall.cpp that loads up function arguments that need to be coerced to a different type may in some cases ignore the fact that the source of the argument is not naturally aligned. This may cause incorrect code to be generated. In some places in CreateCoercedLoad, we already have setAlignment calls to address this, but I ran into one where it was missing, causing wrong code generation on SystemZ. However, in that location, we do not actually know what alignment of the source location we can rely on; the callers do not pass anything to this routine. This is already an issue in other places in CreateCoercedLoad; and the same problem exists for CreateCoercedStore. To avoid pessimising code, and to fix the FIXMEs already in place, this patch also adds an alignment argument to the CreateCoerced* routines and uses it instead of forcing an alignment of 1. The callers are changed to pass in the best information they have. This actually requires changes in a number of existing test cases since we now get better alignment in many places. Differential Revision: http://reviews.llvm.org/D11033 llvm-svn: 241898
Diffstat (limited to 'clang/test/CodeGenCXX/2012-03-16-StoreAlign.cpp')
-rw-r--r--clang/test/CodeGenCXX/2012-03-16-StoreAlign.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/2012-03-16-StoreAlign.cpp b/clang/test/CodeGenCXX/2012-03-16-StoreAlign.cpp
index 7e82ca544dc..5f6189e2451 100644
--- a/clang/test/CodeGenCXX/2012-03-16-StoreAlign.cpp
+++ b/clang/test/CodeGenCXX/2012-03-16-StoreAlign.cpp
@@ -28,7 +28,7 @@ struct Foo {
};
// CHECK: @_ZZN3Foo19getPageSizeFromNameERK6LengthE10legalWidth = linkonce_odr global %struct.Length zeroinitializer, align 4
-// CHECK: store float %{{.*}}, float* getelementptr inbounds (%struct.Length, %struct.Length* @_ZZN3Foo19getPageSizeFromNameERK6LengthE10legalWidth, i32 0, i32 0), align 1
+// CHECK: store float %{{.*}}, float* getelementptr inbounds (%struct.Length, %struct.Length* @_ZZN3Foo19getPageSizeFromNameERK6LengthE10legalWidth, i32 0, i32 0), align 4
bool bar(Length &b) {
Foo f;
OpenPOWER on IntegriCloud