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]

Fix middle-end/17767 (take 2)


Roger Sayle wrote:

I agree with RTH that a better solution to PR middle-end/17767 would
be to correctly implement vector comparisons in both fold_rtx and
simplify_relational_operation_1 (perhaps in addition to a change like
yours above).


I think that proper vector handling in these functions is 4.1 material. A minimum fix for PR17767 and its dupes is atached to this message. Patch is bootstrapped on pentium4-linux-gnu, regtested c,c++. A testcase is also attached.

2005-01-04 Uros Bizjak <uros@kss-loka.si>

   PR middle-end/17767
   * cse.c (fold_rtx) [RTX_COMPARE, RTX_COMM_COMPARE]: Don't attempt
   any simplifications of vector mode comparison operators.
   * simplify-rtx.c (simplify_relational_operation): Fix variable name.

testsuite ChangeLog:
2005-01-04 Uros Bizjak <uros@kss-loka.si>


   PR middle-end/17767
   * gcc.dg/i386-mmx-6.c: New test case.

Uros.

Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.327
diff -u -p -r1.327 cse.c
--- cse.c	26 Nov 2004 15:42:36 -0000	1.327
+++ cse.c	4 Jan 2005 15:02:13 -0000
@@ -3865,6 +3865,10 @@ fold_rtx (rtx x, rtx insn)
 	 constant, set CONST_ARG0 and CONST_ARG1 appropriately.  We needn't
 	 do anything if both operands are already known to be constant.  */
 
+      /* ??? Vector mode comparisons are not supported yet.  */
+      if (VECTOR_MODE_P (mode))
+	break;
+
       if (const_arg0 == 0 || const_arg1 == 0)
 	{
 	  struct table_elt *p0, *p1;
Index: simplify-rtx.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/simplify-rtx.c,v
retrieving revision 1.219
diff -u -p -r1.219 simplify-rtx.c
--- simplify-rtx.c	3 Jan 2005 19:41:06 -0000	1.219
+++ simplify-rtx.c	4 Jan 2005 15:02:14 -0000
@@ -2757,7 +2757,7 @@ simplify_relational_operation (enum rtx_
 #ifdef VECTOR_STORE_FLAG_VALUE
 	  {
 	    int i, units;
-	    rtvec c;
+	    rtvec v;
 
 	    rtx val = VECTOR_STORE_FLAG_VALUE (mode);
 	    if (val == NULL_RTX)
/* PR middle-end/17767 */
/* Contributed by Volker Reichelt */
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O -mmmx" } */
typedef int __m64 __attribute__ ((vector_size (8)));
typedef short __v4hi __attribute__ ((vector_size (8)));

__m64 foo ()
{
  int i;
  __m64 m;

  for (i = 0; i < 2; i++)
    m = (__m64) __builtin_ia32_pcmpeqw ((__v4hi) m, (__v4hi) m);

  return m;
}

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