[trans-mem] PR46923

Submitted by Aldy Hernandez on Dec. 14, 2010, 3:30 p.m.

Details

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

Commit Message

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 hide | download patch | download 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);