mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 15:40:55 +03:00
Fix alignment issue when casting vector rvalue to static array
Previously, the static-array alloca wasn't suitably aligned for the store instruction, which uses the greater vector alignment. This has surfaced now with LLVM 11 on Win32 - this fixes dmd-testsuite's runnable/ldc_llvm_inline_ir.d.
This commit is contained in:
parent
7aea2e73e9
commit
c8889a9219
1 changed files with 1 additions and 2 deletions
|
@ -637,8 +637,7 @@ DValue *DtoCastVector(Loc &loc, DValue *val, Type *to) {
|
||||||
LLValue *vector = DtoRVal(val);
|
LLValue *vector = DtoRVal(val);
|
||||||
IF_LOG Logger::cout() << "src: " << *vector << "to type: " << *tolltype
|
IF_LOG Logger::cout() << "src: " << *vector << "to type: " << *tolltype
|
||||||
<< " (creating temporary)\n";
|
<< " (creating temporary)\n";
|
||||||
LLValue *array = DtoAlloca(to);
|
LLValue *array = DtoAllocaDump(vector, tolltype, DtoAlignment(val->type));
|
||||||
DtoStore(vector, DtoBitCast(array, getPtrToType(vector->getType())));
|
|
||||||
return new DLValue(to, array);
|
return new DLValue(to, array);
|
||||||
}
|
}
|
||||||
if (totype->ty == Tvector && to->size() == val->type->size()) {
|
if (totype->ty == Tvector && to->size() == val->type->size()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue