aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pinski <quic_apinski@quicinc.com>2024-04-17 14:12:17 -0700
committerAndrew Pinski <quic_apinski@quicinc.com>2024-04-30 08:55:19 -0700
commite3a7f359c18bf347f6ac8fcda05e9839fac5bd62 (patch)
tree0b7904bad141f3c37f80b6b26e0a4c5be002b82f
parentf652a35877e32d470d649d1aee5d94fa0169a478 (diff)
Add verification of gimple_assign_nontemporal_move_p [PR112976]
Currently the middle-end only knows how to support temporal stores (the undocumented storent optab) so let's verify that the only time we set nontemporal_move on an assign is if the the lhs is not a gimple reg. Bootstrapped and tested on x86_64-linux-gnu no regressions. gcc/ChangeLog: PR middle-end/112976 * tree-cfg.cc (verify_gimple_assign): Verify that nontmporal moves are stores. * gimple.h (struct gimple): Note that only nontemporal stores are supported. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
-rw-r--r--gcc/gimple.h3
-rw-r--r--gcc/tree-cfg.cc11
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 8a8ca109bbf..bd315ffc2dd 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -236,7 +236,8 @@ struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
for clearing this bit before using it. */
unsigned int visited : 1;
- /* Nonzero if this tuple represents a non-temporal move. */
+ /* Nonzero if this tuple represents a non-temporal move; currently
+ only stores are supported. */
unsigned int nontemporal_move : 1;
/* Pass local flags. These flags are free for any pass to use as
diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc
index b1ba33018fd..1c5b7df8541 100644
--- a/gcc/tree-cfg.cc
+++ b/gcc/tree-cfg.cc
@@ -4837,6 +4837,17 @@ verify_gimple_assign_single (gassign *stmt)
static bool
verify_gimple_assign (gassign *stmt)
{
+ if (gimple_assign_nontemporal_move_p (stmt))
+ {
+ tree lhs = gimple_assign_lhs (stmt);
+ if (is_gimple_reg (lhs))
+ {
+ error ("nontemporal store's lhs cannot be a gimple register");
+ debug_generic_stmt (lhs);
+ return true;
+ }
+ }
+
switch (gimple_assign_rhs_class (stmt))
{
case GIMPLE_SINGLE_RHS: