Small tweak to tree-sra diagnostics

Submitted by Eric Botcazou on Aug. 11, 2017, 1:09 p.m.

Details

Message ID 2370172.aY0gPsU5Pv@arcturus.home
State New
Headers show

Commit Message

Eric Botcazou Aug. 11, 2017, 1:09 p.m.
In the case where build_access_from_expr_1 returns NULL because of a storage 
order barrier.  No functional changes.

Tested on x86_64-suse-linux, applied on the mainline as obvious.


2017-08-11  Eric Botcazou  <ebotcazou@adacore.com>

	* tree-sra.c (build_access_from_expr_1): Use more precise diagnostics
	for storage order barriers.

Patch hide | download patch | download mbox

Index: tree-sra.c
===================================================================
--- tree-sra.c	(revision 250983)
+++ tree-sra.c	(working copy)
@@ -1175,11 +1175,17 @@  build_access_from_expr_1 (tree expr, gimple *stmt,
   else
     partial_ref = false;
 
+  if (storage_order_barrier_p (expr))
+    {
+      disqualify_base_of_expr (expr, "storage order barrier.");
+      return NULL;
+    }
+
   /* We need to dive through V_C_Es in order to get the size of its parameter
      and not the result type.  Ada produces such statements.  We are also
      capable of handling the topmost V_C_E but not any of those buried in other
      handled components.  */
-  if (TREE_CODE (expr) == VIEW_CONVERT_EXPR && !storage_order_barrier_p (expr))
+  if (TREE_CODE (expr) == VIEW_CONVERT_EXPR)
     expr = TREE_OPERAND (expr, 0);
 
   if (contains_view_convert_expr_p (expr))