Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 9e4abb4

Browse files
author
John Criswell
committed
Changed the alignment of an LValue to be 64 bits so that we can handle alignment values up to half of a 64-bit address space. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161971 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 5aad79f commit 9e4abb4

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

lib/CodeGen/CGValue.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class LValue {
128128

129129
// The alignment to use when accessing this lvalue. (For vector elements,
130130
// this is the alignment of the whole vector.)
131-
unsigned short Alignment;
131+
int64_t Alignment;
132132

133133
// objective-c's ivar
134134
bool Ivar:1;

test/CodeGen/align-global-large.c

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// PR13606 - Clang crashes with large alignment attribute
2+
// RUN: %clang -S -emit-llvm %s -o - | FileCheck %s
3+
4+
// CHECK: x
5+
// CHECK: align
6+
// CHECK: 1048576
7+
volatile char x[4000] __attribute__((aligned(0x100000)));
8+
9+
int
10+
main (int argc, char ** argv) {
11+
// CHECK: y
12+
// CHECK: align
13+
// CHECK: 1048576
14+
volatile char y[4000] __attribute__((aligned(0x100000)));
15+
16+
return y[argc];
17+
}
18+

0 commit comments

Comments
 (0)