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]

[PATCH, rs6000] Fix PR65171


Hi,

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65171 identifies a bug when
compiling portions of the Boost library.  The problem occurs in the swap
analysis phase.  Any operand that is TImode or a subreg of TImode is
supposed to disable the swap optimization for the web of instructions
that includes it.  A logic error allowed this to behave properly for
V1TImode, but not for TImode.  This patch corrects that oversight.

The original test case is not suitable for use (far too large and
proprietary).  I am attempting to come up with a reduced test that shows
the problem but don't yet have one.  Since this is a pretty obvious fix
I would like to go forward with the patch, and add a test case at a
later time, if that's ok with you.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no
regressions.  Is this ok for trunk?

Thanks,
Bill


2015-02-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_analyze_swaps): Ensure
	instructions with TImode operands are included in the analysis.


Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 220916)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -34785,7 +34785,7 @@ rs6000_analyze_swaps (function *fun)
 		    mode = V4SImode;
 		}
 
-	      if (VECTOR_MODE_P (mode))
+	      if (VECTOR_MODE_P (mode) || mode == TImode)
 		{
 		  insn_entry[uid].is_relevant = 1;
 		  if (mode == TImode || mode == V1TImode)
@@ -34812,7 +34812,7 @@ rs6000_analyze_swaps (function *fun)
 		  && VECTOR_MODE_P (GET_MODE (SET_DEST (insn))))
 		mode = GET_MODE (SET_DEST (insn));
 
-	      if (VECTOR_MODE_P (mode))
+	      if (VECTOR_MODE_P (mode) || mode == TImode)
 		{
 		  insn_entry[uid].is_relevant = 1;
 		  if (mode == TImode || mode == V1TImode)



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