https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82096

--- Comment #5 from sudi at gcc dot gnu.org ---
As far as I can see, the function expand_atomic_compare_and_swap() calls
emit_store_flag_force() with a explicit VOIDmode and because of this,
do_compare_rtx_and_jump() fails to split the instruction using any
do_jump_by_parts_* (which needs an int_mode). This then moves deep and causes
the forced move instructions with a VOIDmode and causes the ICE. The attached
patch fixes this but I am not sure why the explicit VOIDmode was used on the
first place or if the proposed patch is the right approach here? Anyone got any
ideas?

Sudi

diff --git a/gcc/optabs.c b/gcc/optabs.c
index 3354e40..efc95f7 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -6312,7 +6312,7 @@ expand_atomic_compare_and_swap (rtx *ptarget_bool, rtx
*ptarget_oval,

  success_bool_from_val:
    target_bool = emit_store_flag_force (target_bool, EQ, target_oval,
-                                       expected, VOIDmode, 1, 1);
+                                       expected, mode, 1, 1);
  success:
   /* Make sure that the oval output winds up where the caller asked.  */
   if (ptarget_oval)

Reply via email to