public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
To: jit@gcc.gnu.org
Subject: [PATCH] jit: Fix volatile loads and stores
Date: Wed,  3 Jan 2024 19:09:19 -0300	[thread overview]
Message-ID: <20240103220919.5182-1-yakoyoku@gmail.com> (raw)

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>
---
 gcc/jit/jit-playback.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
index ebe501e9012..ab1ffd3beac 100644
--- a/gcc/jit/jit-playback.cc
+++ b/gcc/jit/jit-playback.cc
@@ -1941,6 +1941,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;
 }
 
-- 
2.43.0


             reply	other threads:[~2024-01-03 22:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03 22:09 Martin Rodriguez Reboredo [this message]
2024-02-06 14:18 ` Martin Rodriguez Reboredo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240103220919.5182-1-yakoyoku@gmail.com \
    --to=yakoyoku@gmail.com \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).