]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
optabs.c (expand_atomic_compare_and_swap): Allow expander to fail.
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>
Fri, 7 Feb 2014 14:20:17 +0000 (14:20 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Fri, 7 Feb 2014 14:20:17 +0000 (14:20 +0000)
2014-02-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

* optabs.c (expand_atomic_compare_and_swap): Allow expander to
fail.

From-SVN: r207599

gcc/ChangeLog
gcc/optabs.c

index df9bc3e5aa62d8ac223658f55835407e227d7198..106a30d39bc2195c17e697005e7ac7419612ea91 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+       * optabs.c (expand_atomic_compare_and_swap): Allow expander to
+       fail.
+
 2014-02-07  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/60092
index e36fd133430e96b0333595225851b45cf335613e..cec25a443cec025c69a413010aa6b93e4c375b0f 100644 (file)
@@ -7383,12 +7383,13 @@ expand_atomic_compare_and_swap (rtx *ptarget_bool, rtx *ptarget_oval,
       create_integer_operand (&ops[5], is_weak);
       create_integer_operand (&ops[6], succ_model);
       create_integer_operand (&ops[7], fail_model);
-      expand_insn (icode, 8, ops);
-
-      /* Return success/failure.  */
-      target_bool = ops[0].value;
-      target_oval = ops[1].value;
-      goto success;
+      if (maybe_expand_insn (icode, 8, ops))
+       {
+         /* Return success/failure.  */
+         target_bool = ops[0].value;
+         target_oval = ops[1].value;
+         goto success;
+       }
     }
 
   /* Otherwise fall back to the original __sync_val_compare_and_swap