diff --git a/src/Type.zig b/src/Type.zig index cdce964356ded3d6f6c1efdd74386560b3a2733c..699bc5159dd7c509751bd9fe3d40c6887ea487ae 100644 --- a/src/Type.zig +++ b/src/Type.zig @@ -3540,10 +3540,7 @@ pub fn packedStructFieldPtrInfo( parent_ptr_info.packed_offset.host_size, parent_ptr_info.packed_offset.bit_offset + bit_offset, } else .{ - switch (zcu.comp.getZigBackend()) { - else => (running_bits + 7) / 8, - .stage2_x86_64 => @intCast(struct_ty.abiSize(zcu)), - }, + @intCast(struct_ty.abiSize(zcu)), bit_offset, }; diff --git a/test/behavior/union.zig b/test/behavior/union.zig index 1eb5608ca4414c923fcd5322a749cdb5940825d3..0cc073fd447ef0e9614cb1b3275b5d19dfe55565 100644 --- a/test/behavior/union.zig +++ b/test/behavior/union.zig @@ -1547,13 +1547,9 @@ test "packed union field pointer has correct alignment" { const bp = &b.u.x; const cp = &c.u.x; - const host_size = switch (builtin.zig_backend) { - else => comptime std.math.divCeil(comptime_int, @bitSizeOf(S), 8) catch unreachable, - .stage2_x86_64 => @sizeOf(S), - }; - comptime assert(@TypeOf(ap) == *align(4:2:host_size) u20); - comptime assert(@TypeOf(bp) == *align(1:2:host_size) u20); - comptime assert(@TypeOf(cp) == *align(64:2:host_size) u20); + comptime assert(@TypeOf(ap) == *align(4:2:@sizeOf(S)) u20); + comptime assert(@TypeOf(bp) == *align(1:2:@sizeOf(S)) u20); + comptime assert(@TypeOf(cp) == *align(64:2:@sizeOf(S)) u20); a.u = .{ .x = 123 }; b.u = .{ .x = 456 };