zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 16b331f5fd9b5e444be031664c4794412fd2081f (tree)
parent 4bf17f0a78f0ff2732a881ca08430fb38ef13891
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Thu, 31 Oct 2024 09:55:31 +0100

Air: Fix mustLower() to consider volatile for a handful of instructions.

These can all potentially operate on volatile pointers.

Diffstat:
Msrc/Air.zig | 8++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/Air.zig b/src/Air.zig @@ -1799,12 +1799,8 @@ pub fn mustLower(air: Air, inst: Air.Inst.Index, ip: *const InternPool) bool { .cmp_vector_optimized, .is_null, .is_non_null, - .is_null_ptr, - .is_non_null_ptr, .is_err, .is_non_err, - .is_err_ptr, - .is_non_err_ptr, .bool_and, .bool_or, .fptrunc, @@ -1817,7 +1813,6 @@ pub fn mustLower(air: Air, inst: Air.Inst.Index, ip: *const InternPool) bool { .unwrap_errunion_payload, .unwrap_errunion_err, .unwrap_errunion_payload_ptr, - .unwrap_errunion_err_ptr, .wrap_errunion_payload, .wrap_errunion_err, .struct_field_ptr, @@ -1862,7 +1857,8 @@ pub fn mustLower(air: Air, inst: Air.Inst.Index, ip: *const InternPool) bool { .work_group_id, => false, - .load => air.typeOf(data.ty_op.operand, ip).isVolatilePtrIp(ip), + .is_non_null_ptr, .is_null_ptr, .is_non_err_ptr, .is_err_ptr => air.typeOf(data.un_op, ip).isVolatilePtrIp(ip), + .load, .unwrap_errunion_err_ptr => air.typeOf(data.ty_op.operand, ip).isVolatilePtrIp(ip), .slice_elem_val, .ptr_elem_val => air.typeOf(data.bin_op.lhs, ip).isVolatilePtrIp(ip), .atomic_load => switch (data.atomic_load.order) { .unordered, .monotonic => air.typeOf(data.atomic_load.ptr, ip).isVolatilePtrIp(ip),