omp-expand.c (oxpand_omp_atomic_fetch_op, [...]): Return false if can_atomic_load_p...
authorJakub Jelinek <jakub@redhat.com>
Mon, 6 Feb 2017 19:25:02 +0000 (20:25 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 6 Feb 2017 19:25:02 +0000 (20:25 +0100)
* omp-expand.c (oxpand_omp_atomic_fetch_op,
expand_omp_atomic_pipeline): Return false if can_atomic_load_p is
false.

From-SVN: r245216

gcc/ChangeLog
gcc/omp-expand.c

index 7113dce7e1b44b170ea949e96030a49331ffd01e..51b48591a719659bf8f7821f7f91354c7388d364 100644 (file)
@@ -1,3 +1,9 @@
+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>
 
        PR rtl-optimization/68664
index 327c2e73d915ae3b6e7555310bb9e3c2d63cccb7..736573611a343b613bd7df8584c12bb82a8328ed 100644 (file)
@@ -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
      that support any atomic operaton optab also implements compare-and-swap.
      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;
 
   gsi = gsi_last_bb (load_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)));
   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;
 
   /* Load the initial value, replacing the GIMPLE_OMP_ATOMIC_LOAD.  */