Skip to content

Commit fd30be0

Browse files
committed
Also skip in Rvalue::Aggregate
1 parent 74a4a77 commit fd30be0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
165165
assert_eq!(operands.len(), 1);
166166
}
167167
for (i, operand) in operands.iter_enumerated() {
168+
if let mir::Operand::Constant(const_op) = operand {
169+
let val = self.eval_mir_constant(const_op);
170+
if val.all_bytes_uninit(self.cx.tcx()) {
171+
continue;
172+
}
173+
}
174+
168175
let op = self.codegen_operand(bx, operand);
169176
// Do not generate stores and GEPis for zero-sized fields.
170177
if !op.layout.is_zst() {

0 commit comments

Comments
 (0)