This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sync_fetch_and_add creating unrecognizable insn


	No.

	Appended is what I already found and am testing.

	* config/rs6000/rs6000.c (emit_sync): Change aligned QImode and
	HImode MEM to SImode.

Index: rs6000.c
===================================================================
--- rs6000.c	(revision 127335)
+++ rs6000.c	(working copy)
@@ -12737,6 +12737,8 @@
 	    ishift = GET_MODE_BITSIZE (SImode) - GET_MODE_BITSIZE (mode);
 
 	  shift = GEN_INT (ishift);
+
+	  used_m = change_address (used_m, SImode, NULL_RTX);
 	}
       else
 	{
@@ -12757,15 +12759,16 @@
 				       1, OPTAB_LIB_WIDEN);
 	  used_m = change_address (used_m, SImode, aligned_addr);
 	  set_mem_align (used_m, 32);
-	  /* It's safe to keep the old alias set of USED_M, because
-	     the operation is atomic and only affects the original
-	     USED_M.  */
-	  if (GET_CODE (m) == NOT)
-	    m = gen_rtx_NOT (SImode, used_m);
-	  else
-	    m = used_m;
 	}
 
+	/* It's safe to keep the old alias set of USED_M, because
+	   the operation is atomic and only affects the original
+	   USED_M.  */
+	if (GET_CODE (m) == NOT)
+	  m = gen_rtx_NOT (SImode, used_m);
+	else
+	  m = used_m;
+
       if (GET_CODE (op) == NOT)
 	{
 	  oldop = lowpart_subreg (SImode, XEXP (op, 0), mode);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]