about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-28 10:18:32 +0000
committerbors <bors@rust-lang.org>2025-03-28 10:18:32 +0000
commit2a06022951893fe5b5384f8dbd75b4e6e3b5cee0 (patch)
treec03e2eb1cf5ee8a760a01e53b150b74c033bc4b6 /compiler/rustc_codegen_gcc
parente77a8f439cc87c5d67b007e9811578533de1de91 (diff)
parent5c82a59bd30815a942b64fa09e22dbe442edf56d (diff)
downloadrust-2a06022951893fe5b5384f8dbd75b4e6e3b5cee0.tar.gz
rust-2a06022951893fe5b5384f8dbd75b4e6e3b5cee0.zip
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
Diffstat (limited to 'compiler/rustc_codegen_gcc')
-rw-r--r--compiler/rustc_codegen_gcc/src/consts.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_gcc/src/consts.rs b/compiler/rustc_codegen_gcc/src/consts.rs
index c514b7a428b..474475f311f 100644
--- a/compiler/rustc_codegen_gcc/src/consts.rs
+++ b/compiler/rustc_codegen_gcc/src/consts.rs
@@ -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)
 }