Skip to content

Commit

Permalink
jit: Fix volatile loads and stores
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YakoYakoYokuYoku authored and antoyo committed Nov 18, 2024
1 parent 85e56c5 commit 50d1270
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gcc/jit/jit-playback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,10 @@ new_dereference (tree ptr,
tree datum = fold_build1 (INDIRECT_REF, type, ptr);
if (loc)
set_tree_location (datum, loc);
if (TYPE_VOLATILE (type)) {
TREE_THIS_VOLATILE (datum) = 1;
TREE_SIDE_EFFECTS (datum) = 1;
}
return datum;
}

Expand Down

0 comments on commit 50d1270

Please sign in to comment.