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  <[email protected]>

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 <[email protected]>
  • Loading branch information
YakoYakoYokuYoku authored and antoyo committed Nov 21, 2024
1 parent eee13e9 commit 5de134e
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 @@ -1981,6 +1981,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 5de134e

Please sign in to comment.