diff options
| author | bors <bors@rust-lang.org> | 2025-01-21 09:45:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-01-21 09:45:24 +0000 |
| commit | a7a6c64a657f68113301c2ffe0745b49a16442d1 (patch) | |
| tree | e040f9fb970dd0d77b98a2fa299e71df38b37ef7 /compiler/rustc_codegen_gcc | |
| parent | ebbe63891f1fae21734cb97f2f863b08b1d44bf8 (diff) | |
| parent | 8f5f5e56a8edbe3a231441f6051fb7dc4ed8e193 (diff) | |
| download | rust-a7a6c64a657f68113301c2ffe0745b49a16442d1.tar.gz rust-a7a6c64a657f68113301c2ffe0745b49a16442d1.zip | |
Auto merge of #135335 - oli-obk:push-zxwssomxxtnq, r=saethlin
codegen: store ScalarPair via memset when one side is undef and the other side can be memset Basically since `undef` can be any byte, it can also be the byte(s) that are in the non-undef parts of a value. So we can just treat the `undef` at not being there and only look at the initialized bytes and memset over them fixes #104290 based on https://github.com/rust-lang/rust/pull/135258
Diffstat (limited to 'compiler/rustc_codegen_gcc')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/common.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_gcc/src/common.rs b/compiler/rustc_codegen_gcc/src/common.rs index f43743fc2a4..bd5d6ba387c 100644 --- a/compiler/rustc_codegen_gcc/src/common.rs +++ b/compiler/rustc_codegen_gcc/src/common.rs @@ -64,6 +64,11 @@ impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> { if type_is_pointer(typ) { self.context.new_null(typ) } else { self.const_int(typ, 0) } } + fn is_undef(&self, _val: RValue<'gcc>) -> bool { + // FIXME: actually check for undef + false + } + 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() { |
