Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AsmPrinter] Increase upper bound for size in global structs #92334

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3501,7 +3501,7 @@ static void emitGlobalConstantStruct(const DataLayout &DL,
const Constant *BaseCV, uint64_t Offset,
AsmPrinter::AliasMapTy *AliasList) {
// Print the fields in successive locations. Pad to align if needed!
unsigned Size = DL.getTypeAllocSize(CS->getType());
uint64_t Size = DL.getTypeAllocSize(CS->getType());
const StructLayout *Layout = DL.getStructLayout(CS->getType());
uint64_t SizeSoFar = 0;
for (unsigned I = 0, E = CS->getNumOperands(); I != E; ++I) {
Expand Down
7 changes: 7 additions & 0 deletions llvm/test/CodeGen/X86/big-array-init.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; RUN: llc < %s -mtriple=x86_64 | FileCheck %s

; CHECK-LABEL: bad_int:
; CHECK-NEXT: .long 1
; CHECK-NEXT: .zero 4294967292
; CHECK-NEXT: .size bad_int, 4294967296
@bad_int = global <{ i32, [1073741823 x i32] }> <{ i32 1, [1073741823 x i32] zeroinitializer }>, align 16
Loading