Commit d0f305b1 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/45838 (FAIL: libgomp.c/pr34513.c execution test)

	PR middle-end/45838
	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
	call_may_clobber_ref_p_1): Return true for __sync_* and some
	OpenMP builtins that act as threading barriers.

Co-Authored-By: Richard Guenther <rguenther@suse.de>

From-SVN: r166863
parent 5ac60b56
2010-11-17 Jakub Jelinek <jakub@redhat.com>
Richard Guenther <rguenther@suse.de>
PR middle-end/45838
* tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
call_may_clobber_ref_p_1): Return true for __sync_* and some
OpenMP builtins that act as threading barriers.
2010-11-17 Richard Guenther <rguenther@suse.de> 2010-11-17 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46498 PR tree-optimization/46498
...@@ -1209,6 +1209,28 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref) ...@@ -1209,6 +1209,28 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
case BUILT_IN_SINCOSF: case BUILT_IN_SINCOSF:
case BUILT_IN_SINCOSL: case BUILT_IN_SINCOSL:
return false; return false;
/* __sync_* builtins and some OpenMP builtins act as threading
barriers. */
#undef DEF_SYNC_BUILTIN
#define DEF_SYNC_BUILTIN(ENUM, NAME, TYPE, ATTRS) case ENUM:
#include "sync-builtins.def"
#undef DEF_SYNC_BUILTIN
case BUILT_IN_GOMP_ATOMIC_START:
case BUILT_IN_GOMP_ATOMIC_END:
case BUILT_IN_GOMP_BARRIER:
case BUILT_IN_GOMP_TASKWAIT:
case BUILT_IN_GOMP_CRITICAL_START:
case BUILT_IN_GOMP_CRITICAL_END:
case BUILT_IN_GOMP_CRITICAL_NAME_START:
case BUILT_IN_GOMP_CRITICAL_NAME_END:
case BUILT_IN_GOMP_LOOP_END:
case BUILT_IN_GOMP_ORDERED_START:
case BUILT_IN_GOMP_ORDERED_END:
case BUILT_IN_GOMP_PARALLEL_END:
case BUILT_IN_GOMP_SECTIONS_END:
case BUILT_IN_GOMP_SINGLE_COPY_START:
case BUILT_IN_GOMP_SINGLE_COPY_END:
return true;
default: default:
/* Fallthru to general call handling. */; /* Fallthru to general call handling. */;
...@@ -1465,6 +1487,28 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref) ...@@ -1465,6 +1487,28 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
return (ptr_deref_may_alias_ref_p_1 (sin, ref) return (ptr_deref_may_alias_ref_p_1 (sin, ref)
|| ptr_deref_may_alias_ref_p_1 (cos, ref)); || ptr_deref_may_alias_ref_p_1 (cos, ref));
} }
/* __sync_* builtins and some OpenMP builtins act as threading
barriers. */
#undef DEF_SYNC_BUILTIN
#define DEF_SYNC_BUILTIN(ENUM, NAME, TYPE, ATTRS) case ENUM:
#include "sync-builtins.def"
#undef DEF_SYNC_BUILTIN
case BUILT_IN_GOMP_ATOMIC_START:
case BUILT_IN_GOMP_ATOMIC_END:
case BUILT_IN_GOMP_BARRIER:
case BUILT_IN_GOMP_TASKWAIT:
case BUILT_IN_GOMP_CRITICAL_START:
case BUILT_IN_GOMP_CRITICAL_END:
case BUILT_IN_GOMP_CRITICAL_NAME_START:
case BUILT_IN_GOMP_CRITICAL_NAME_END:
case BUILT_IN_GOMP_LOOP_END:
case BUILT_IN_GOMP_ORDERED_START:
case BUILT_IN_GOMP_ORDERED_END:
case BUILT_IN_GOMP_PARALLEL_END:
case BUILT_IN_GOMP_SECTIONS_END:
case BUILT_IN_GOMP_SINGLE_COPY_START:
case BUILT_IN_GOMP_SINGLE_COPY_END:
return true;
default: default:
/* Fallthru to general call handling. */; /* Fallthru to general call handling. */;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment