about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-03-14 15:56:33 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-03-28 09:19:57 +0000
commita5fa12b6b908894f59a788641c4b14839e556c5f (patch)
tree723c7409ef9e8d964dc492cb96ab533d585a7def /compiler/rustc_codegen_gcc
parentf7b43542838f0a4a6cfdb17fbeadf45002042a77 (diff)
downloadrust-a5fa12b6b908894f59a788641c4b14839e556c5f.tar.gz
rust-a5fa12b6b908894f59a788641c4b14839e556c5f.zip
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.
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)
 }