This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] optabs: Allow CAS expanders to fail
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 7 Feb 2014 14:33:41 +0100
- Subject: Re: [PATCH] optabs: Allow CAS expanders to fail
- Authentication-results: sourceware.org; auth=none
- References: <20140207115837 dot GA25280 at bart>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Feb 07, 2014 at 12:58:37PM +0100, Andreas Krebbel wrote:
> 2014-02-07 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
>
> * optabs.c (expand_atomic_compare_and_swap): Allow expander to
> fail.
Ok.
> --- 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
Jakub