diff mbox

Remove support for atomic_clear pattern

Message ID 87wpxhlrx7.fsf@e105548-lin.cambridge.arm.com
State New
Headers show

Commit Message

Richard Sandiford July 30, 2015, 1:02 p.m. UTC
expand_builtin_atomic_clear has code to handle an atomic_clear instruction.
However, no target defines such a pattern, and the code wouldn't compile
on any target that tried to define it, since the generator is passed the
memory model enum directly rather than via an rtx wrapper.  It seems better
to remove the code rather than try to update it.

No documentation changes are needed because the pattern isn't mentioned
in md.texi.

Bootstrapped & regression-tested on x86_64-linux-gnu.  Grepped for references
to atomic_clear to make sure that no such pattern exists.  OK to install?

Thanks,
Richard

gcc/
	* builtins.c (HAVE_atomic_clear, gen_atomic_clear): Delete.
	(expand_builtin_atomic_clear): Remove support for atomic_clear
	pattern.

Comments

Richard Biener July 30, 2015, 1:10 p.m. UTC | #1
On Thu, Jul 30, 2015 at 3:02 PM, Richard Sandiford
<richard.sandiford@arm.com> wrote:
> expand_builtin_atomic_clear has code to handle an atomic_clear instruction.
> However, no target defines such a pattern, and the code wouldn't compile
> on any target that tried to define it, since the generator is passed the
> memory model enum directly rather than via an rtx wrapper.  It seems better
> to remove the code rather than try to update it.
>
> No documentation changes are needed because the pattern isn't mentioned
> in md.texi.
>
> Bootstrapped & regression-tested on x86_64-linux-gnu.  Grepped for references
> to atomic_clear to make sure that no such pattern exists.  OK to install?

Ok.

Thanks,
Richard.

> Thanks,
> Richard
>
> gcc/
>         * builtins.c (HAVE_atomic_clear, gen_atomic_clear): Delete.
>         (expand_builtin_atomic_clear): Remove support for atomic_clear
>         pattern.
>
> diff --git a/gcc/builtins.c b/gcc/builtins.c
> index 1750e25..d7eb65f 100644
> --- a/gcc/builtins.c
> +++ b/gcc/builtins.c
> @@ -5587,12 +5587,6 @@ expand_builtin_atomic_fetch_op (machine_mode mode, tree exp, rtx target,
>    return ret;
>  }
>
> -
> -#ifndef HAVE_atomic_clear
> -# define HAVE_atomic_clear 0
> -# define gen_atomic_clear(x,y) (gcc_unreachable (), NULL_RTX)
> -#endif
> -
>  /* Expand an atomic clear operation.
>         void _atomic_clear (BOOL *obj, enum memmodel)
>     EXP is the call expression.  */
> @@ -5615,12 +5609,6 @@ expand_builtin_atomic_clear (tree exp)
>        model = MEMMODEL_SEQ_CST;
>      }
>
> -  if (HAVE_atomic_clear)
> -    {
> -      emit_insn (gen_atomic_clear (mem, model));
> -      return const0_rtx;
> -    }
> -
>    /* Try issuing an __atomic_store, and allow fallback to __sync_lock_release.
>       Failing that, a store is issued by __atomic_store.  The only way this can
>       fail is if the bool type is larger than a word size.  Unlikely, but
>
diff mbox

Patch

diff --git a/gcc/builtins.c b/gcc/builtins.c
index 1750e25..d7eb65f 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5587,12 +5587,6 @@  expand_builtin_atomic_fetch_op (machine_mode mode, tree exp, rtx target,
   return ret;
 }
 
-
-#ifndef HAVE_atomic_clear
-# define HAVE_atomic_clear 0
-# define gen_atomic_clear(x,y) (gcc_unreachable (), NULL_RTX)
-#endif
-
 /* Expand an atomic clear operation.
 	void _atomic_clear (BOOL *obj, enum memmodel)
    EXP is the call expression.  */
@@ -5615,12 +5609,6 @@  expand_builtin_atomic_clear (tree exp)
       model = MEMMODEL_SEQ_CST;
     }
 
-  if (HAVE_atomic_clear)
-    {
-      emit_insn (gen_atomic_clear (mem, model));
-      return const0_rtx;
-    }
-
   /* Try issuing an __atomic_store, and allow fallback to __sync_lock_release.
      Failing that, a store is issued by __atomic_store.  The only way this can
      fail is if the bool type is larger than a word size.  Unlikely, but