From 8bd7070a7a6fc94831aa9a67083ae038410ab19b Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Fri, 7 Feb 2014 14:20:17 +0000 Subject: [PATCH] optabs.c (expand_atomic_compare_and_swap): Allow expander to fail. 2014-02-07 Andreas Krebbel * optabs.c (expand_atomic_compare_and_swap): Allow expander to fail. From-SVN: r207599 --- gcc/ChangeLog | 5 +++++ gcc/optabs.c | 13 +++++++------ 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 + + * optabs.c (expand_atomic_compare_and_swap): Allow expander to + fail. + 2014-02-07 Richard Biener 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 -- 2.7.4