Auto merge of #138503 - bjorn3:string_merging, r=tmiasko

Avoid wrapping constant allocations in packed structs when not necessary

This way LLVM will set the string merging flag if the alloc is a nul terminated string, reducing binary sizes.

try-job: armhf-gnu
This commit is contained in:
bors 2025-03-28 10:18:32 +00:00
commit de1dd8beee

View file

@ -364,6 +364,7 @@ pub fn const_alloc_to_gcc<'gcc>(
llvals.push(cx.const_bytes(bytes));
}
// FIXME(bjorn3) avoid wrapping in a struct when there is only a single element.
cx.const_struct(&llvals, true)
}