Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 50d1270

Browse files
YakoYakoYokuYokuantoyo
authored andcommittedNov 18, 2024·
jit: Fix volatile loads and stores
Related to PR d/110516 but for libgccjit. 2024-01-03 Martin Rodriguez Reboredo <yakoyoku@gmail.com> gcc/jit/ * jit-playback.cc: Append TREE_THIS_VOLATILE and TREE_SIDE_EFFECTS to a dereference if underlying type is volatile. Signed-off-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎gcc/jit/jit-playback.cc

+4
Original file line numberDiff line numberDiff line change
@@ -1988,6 +1988,10 @@ new_dereference (tree ptr,
19881988
tree datum = fold_build1 (INDIRECT_REF, type, ptr);
19891989
if (loc)
19901990
set_tree_location (datum, loc);
1991+
if (TYPE_VOLATILE (type)) {
1992+
TREE_THIS_VOLATILE (datum) = 1;
1993+
TREE_SIDE_EFFECTS (datum) = 1;
1994+
}
19911995
return datum;
19921996
}
19931997

0 commit comments

Comments
 (0)
Please sign in to comment.