[clang] [Clang][CodeGen] Preserve alignment information for pointer arithmetics (PR #152575)

Yingwei Zheng via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 7 12:06:51 PDT 2025


================
@@ -55,7 +55,7 @@ int align3_x0 = __alignof(((struct s3*) 0)->x[0]);
 // CHECK:   load i32, ptr %{{.*}}, align 1
 // CHECK: }
 // CHECK-LABEL: define{{.*}} i32 @f0_b
-// CHECK:   load i32, ptr %{{.*}}, align 4
+// CHECK:   load i32, ptr %{{.*}}, align 1
----------------
dtcxzyw wrote:

It matches GCC's behavior: https://godbolt.org/z/TeGqTY1qc

https://github.com/llvm/llvm-project/pull/152575


More information about the cfe-commits mailing list