[trans-mem] PR46923
diff mbox

Message ID 4D078D98.9020801@redhat.com
State New
Headers show

Commit Message

Aldy Hernandez Dec. 14, 2010, 3:30 p.m. UTC
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.

	* trans-mem.c (requires_barrier): Handle PARM_DECL and

diff mbox

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);