Patchwork [trans-mem] PR46923

login
register
mail settings
Submitter Aldy Hernandez
Date Dec. 14, 2010, 3:30 p.m.
Message ID <4D078D98.9020801@redhat.com>
Download mbox | patch
Permalink /patch/75500/
State New
Headers show

Comments

Aldy Hernandez - Dec. 14, 2010, 3:30 p.m.
requires_barrier should really handle PARM_DECL and RESULT_DECLs, 
because they can escape the function just like any other variable.

The testcase in the PR isn't really valid, because volatiles aren't 
allowed inside transactions.  It was just there to force a small 
reproducible testcase.  Next I will work on warning if we ever try to 
use volatiles inside transactions.

Over-the-shoulder approval, committing, and closing the PR.

Aldy
PR/46923
	* trans-mem.c (requires_barrier): Handle PARM_DECL and
	RESULT_DECL.

Patch

Index: trans-mem.c
===================================================================
--- trans-mem.c	(revision 167796)
+++ trans-mem.c	(working copy)
@@ -1432,6 +1432,8 @@  requires_barrier (basic_block entry_bloc
       gcc_assert (TREE_CODE (x) == VAR_DECL);
       /* FALLTHRU */
 
+    case PARM_DECL:
+    case RESULT_DECL:
     case VAR_DECL:
       if (is_global_var (x))
 	return !TREE_READONLY (x);