aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>2014-02-07 14:20:17 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2014-02-07 14:20:17 +0000
commit8bd7070a7a6fc94831aa9a67083ae038410ab19b (patch)
tree568308588a3d98d59b2346356c4d5a36e636405b
parent831806cb211df749b12f47ee4b669e30f7a5f009 (diff)
downloadgcc-8bd7070a7a6fc94831aa9a67083ae038410ab19b.zip
gcc-8bd7070a7a6fc94831aa9a67083ae038410ab19b.tar.gz
gcc-8bd7070a7a6fc94831aa9a67083ae038410ab19b.tar.bz2
optabs.c (expand_atomic_compare_and_swap): Allow expander to fail.
2014-02-07 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * optabs.c (expand_atomic_compare_and_swap): Allow expander to fail. From-SVN: r207599
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/optabs.c13
2 files changed, 12 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index df9bc3e..106a30d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/optabs.c b/gcc/optabs.c
index e36fd13..cec25a4 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -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