[cfe-users] How to change alignment of long long

Philipp Klaus Krause via cfe-users cfe-users at lists.llvm.org
Fri Oct 21 09:50:56 PDT 2016

In clang-3.8, I'm trying to have some data types aligned on 8-bit
boundaries, which works for everything except long long.

In my target, I've used:

IntAlign = 8;
LongAlign = 8;
LongLongAlign = 8;
FloatAlign = 8;
DataLayoutString =

If I compile this test.c

int i;
long l;
long long ll;
float f;

I get the following test.ll:

; ModuleID = 'test.c'
target datalayout =
target triple = "sdcc-stm8"

@i = common global i16 0, align 1
@l = common global i32 0, align 1
@ll = common global i64 0, align 8
@f = common global float 0.000000e+00, align 1

!llvm.ident = !{!0}

!0 = !{!"clang version 3.8.1 "}

So the alignment is wrong for long long only.

It seems someone else had such a problem in January
(http://lists.llvm.org/pipermail/llvm-dev/2016-January/094000.html), but
I don't see a solution there.


More information about the cfe-users mailing list