about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/common.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-06-30 16:12:42 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-06-30 16:12:42 +0200
commit666934ac54b6732907820be6421dd525d4ace3e8 (patch)
tree783f01ea850a244be118329928ee7a6aec4d2688 /compiler/rustc_codegen_gcc/src/common.rs
parentf19142044f270760ce0ebc03b2c3a44217d8703d (diff)
parent4b5c44b14166083eef8d71f15f5ea1f53fc976a0 (diff)
downloadrust-666934ac54b6732907820be6421dd525d4ace3e8.tar.gz
rust-666934ac54b6732907820be6421dd525d4ace3e8.zip
Merge commit '4b5c44b14166083eef8d71f15f5ea1f53fc976a0' into subtree-update_cg_gcc_2025-06-30
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/common.rs')
-rw-r--r--compiler/rustc_codegen_gcc/src/common.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/compiler/rustc_codegen_gcc/src/common.rs b/compiler/rustc_codegen_gcc/src/common.rs
index fdd47821b51..38348a48e47 100644
--- a/compiler/rustc_codegen_gcc/src/common.rs
+++ b/compiler/rustc_codegen_gcc/src/common.rs
@@ -117,15 +117,7 @@ impl<'gcc, 'tcx> ConstCodegenMethods for CodegenCx<'gcc, 'tcx> {
 
     fn const_undef(&self, typ: Type<'gcc>) -> RValue<'gcc> {
         let local = self.current_func.borrow().expect("func").new_local(None, typ, "undefined");
-        if typ.is_struct().is_some() {
-            // NOTE: hack to workaround a limitation of the rustc API: see comment on
-            // CodegenCx.structs_as_pointer
-            let pointer = local.get_address(None);
-            self.structs_as_pointer.borrow_mut().insert(pointer);
-            pointer
-        } else {
-            local.to_rvalue()
-        }
+        local.to_rvalue()
     }
 
     fn const_poison(&self, typ: Type<'gcc>) -> RValue<'gcc> {