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] add operand constraint for ix86 prefetch; fixes PR target/5379


This patch fixes the bug reported in PR target/5379.  It has been
bootstrapped and tested on i686-pc-linux-gnu along with the patches in
http://gcc.gnu.org/ml/gcc-patches/2002-01/msg01393.html and
http://gcc.gnu.org/ml/gcc-patches/2002-01/msg01071.html.

2002-01-21  Janis Johnson  <janis187@us.ibm.com>

	PR target/5379
	* config/i386/i386.md (prefetch): Specify "p" as a constraint for
	the address operand.
	(prefetch_sse): Ditto.

testsuite:

	* gcc.dg/20020121-1.c: New test.

Index: config/i386/i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.331
diff -u -p -r1.331 i386.md
--- i386.md	2002/01/16 17:16:42	1.331
+++ i386.md	2002/01/18 00:46:35
@@ -19600,7 +19600,7 @@
   [(set_attr "type" "mmx")])
 
 (define_expand "prefetch"
-  [(prefetch (match_operand:SI 0 "address_operand" "")
+  [(prefetch (match_operand:SI 0 "address_operand" "p")
 	     (match_operand:SI 1 "const_int_operand" "")
 	     (match_operand:SI 2 "const_int_operand" ""))]
   "TARGET_PREFETCH_SSE || TARGET_3DNOW"
@@ -19624,7 +19624,7 @@
 })
 
 (define_insn "*prefetch_sse"
-  [(prefetch (match_operand:SI 0 "address_operand" "")
+  [(prefetch (match_operand:SI 0 "address_operand" "p")
 	     (const_int 0)
 	     (match_operand:SI 1 "const_int_operand" ""))]
   "TARGET_PREFETCH_SSE"
--- /dev/null	Tue May 23 09:27:54 2000
+++ gcc.dg/20020121-1.c	Thu Jan 17 15:59:20 2002
@@ -0,0 +1,40 @@
+/* This test was supplied with PR target/5379.  It caused the compiler
+   to get a segmentation fault.  */
+  
+/* { dg-do compile { target i?86-*-* } } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon" } */
+
+extern int access( char* );
+extern int a();
+char* foocp();
+
+void
+_KDE_IceGetPoValidAuthIndices (protocol_name, num_indices_ret, indices_ret)
+const char *protocol_name;
+int *num_indices_ret;
+int *indices_ret;
+{
+    int auth_file;
+    char *filename;
+    int index_ret, i;
+
+    if (!(filename = foocp ()))
+        return;
+
+    if (access (filename))
+        return;
+
+    if (auth_file = access (filename))
+        return;
+
+    for (;;)
+    {
+        if (strcmp (protocol_name, protocol_name) == 0 )
+        {
+            for (i = 0; i < *num_indices_ret; i++)
+                if (index_ret == indices_ret[i])
+                    break;
+        }
+    }
+}
+


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