Commit dc06356a by Jakub Jelinek Committed by Jakub Jelinek

omp-expand.c (oxpand_omp_atomic_fetch_op, [...]): Return false if can_atomic_load_p is false.

	* omp-expand.c (oxpand_omp_atomic_fetch_op,
	expand_omp_atomic_pipeline): Return false if can_atomic_load_p is
	false.

From-SVN: r245216
parent 176274c9
2017-02-06 Jakub Jelinek <jakub@redhat.com>
* omp-expand.c (oxpand_omp_atomic_fetch_op,
expand_omp_atomic_pipeline): Return false if can_atomic_load_p is
false.
2017-02-06 Segher Boessenkool <segher@kernel.crashing.org> 2017-02-06 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/68664 PR rtl-optimization/68664
......
...@@ -6241,7 +6241,7 @@ expand_omp_atomic_fetch_op (basic_block load_bb, ...@@ -6241,7 +6241,7 @@ expand_omp_atomic_fetch_op (basic_block load_bb,
matter is that (with the exception of i486 vs i586 and xadd) all targets matter is that (with the exception of i486 vs i586 and xadd) all targets
that support any atomic operaton optab also implements compare-and-swap. that support any atomic operaton optab also implements compare-and-swap.
Let optabs.c take care of expanding any compare-and-swap loop. */ Let optabs.c take care of expanding any compare-and-swap loop. */
if (!can_compare_and_swap_p (imode, true)) if (!can_compare_and_swap_p (imode, true) || !can_atomic_load_p (imode))
return false; return false;
gsi = gsi_last_bb (load_bb); gsi = gsi_last_bb (load_bb);
...@@ -6318,7 +6318,8 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb, ...@@ -6318,7 +6318,8 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (addr))); type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (addr)));
itype = TREE_TYPE (TREE_TYPE (cmpxchg)); itype = TREE_TYPE (TREE_TYPE (cmpxchg));
if (!can_compare_and_swap_p (TYPE_MODE (itype), true)) if (!can_compare_and_swap_p (TYPE_MODE (itype), true)
|| !can_atomic_load_p (TYPE_MODE (itype)))
return false; return false;
/* Load the initial value, replacing the GIMPLE_OMP_ATOMIC_LOAD. */ /* Load the initial value, replacing the GIMPLE_OMP_ATOMIC_LOAD. */
......
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