diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2003-04-26 20:44:30 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2003-04-26 20:44:30 +0000 |
commit | 5cc2f4f36ffd5f3d47346f330b15337afdbe4927 (patch) | |
tree | bfbdbe4fa86ef8e6019e8119026700d36ca99abe /gcc | |
parent | e2b694230a73dbc6e0a2248fb8aba226ebdbc678 (diff) | |
download | gcc-5cc2f4f36ffd5f3d47346f330b15337afdbe4927.zip gcc-5cc2f4f36ffd5f3d47346f330b15337afdbe4927.tar.gz gcc-5cc2f4f36ffd5f3d47346f330b15337afdbe4927.tar.bz2 |
md.texi (cmpstr): Document additional restrictions.
gcc:
* doc/md.texi (cmpstr): Document additional restrictions.
testsuite:
* gcc.c-torture/execute/string-opt-8.c: Don't perform cmpstr
checks for __pj__, but do them for !__OPTIMIZE__ and __s390__.
From-SVN: r66116
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/doc/md.texi | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/string-opt-8.c | 5 |
4 files changed, 18 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f96ea70..0f83a2b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2003-04-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * doc/md.texi (cmpstr): Document additional restrictions. + 2003-04-26 Neil Booth <neil@daikokuya.co.uk> * flags.h (time_report): Remove. diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index da7e38b..c808d49 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -2788,9 +2788,12 @@ The use for multiple @code{clrstr@var{m}} is as for @code{movstr@var{m}}. Block compare instruction, with five operands. Operand 0 is the output; it has mode @var{m}. The remaining four operands are like the operands of @samp{movstr@var{m}}. The two memory blocks specified are compared -byte by byte in lexicographic order. The effect of the instruction is -to store a value in operand 0 whose sign indicates the result of the -comparison. +byte by byte in lexicographic order starting at the beginning of each +string. The instruction is not allowed to prefetch more than one byte +at a time since either string may end in the first byte and reading past +that may access an invalid page or segment and cause a fault. The +effect of the instruction is to store a value in operand 0 whose sign +indicates the result of the comparison. @cindex @code{strlen@var{m}} instruction pattern @item @samp{strlen@var{m}} diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2590adf..9c0ef12 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-04-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * gcc.c-torture/execute/string-opt-8.c: Don't perform cmpstr + checks for __pj__, but do them for !__OPTIMIZE__ and __s390__. + 2003-04-25 Mark Mitchell <mark@codesourcery.com> * g++.old-deja/g++.pt/instantiate12.C: Explicit instantiate diff --git a/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c b/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c index 8fef5b5..5ab3a99 100644 --- a/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c +++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c @@ -65,8 +65,9 @@ int main () s2 = s1; s3 = s1+4; if (strncmp (++s2, ++s3+2, 1) >= 0 || s2 != s1+1 || s3 != s1+5) abort(); -#if defined(__i386__) || defined (__pj__) || defined (__i370__) - /* These tests work on platforms which support cmpstrsi. */ +#if !defined(__OPTIMIZE__) || defined(__i386__) || defined (__i370__) || defined (__s390__) + /* These tests work on platforms which support cmpstrsi. We test it + at -O0 on all platforms to ensure the strncmp logic is correct. */ s2 = s1; if (strncmp (++s2, "ello", 3) != 0 || s2 != s1+1) abort(); |