aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-10-11 21:11:29 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-10-11 21:11:29 +0000
commitc43fa1f51a746777e557c1ca99b6111474c5c961 (patch)
tree3038c6d3362d74076b56b1b91ed777dad3dc5708 /gcc/testsuite/gcc.c-torture
parentc877353c907f31f7af74452d4eb2c44b6900493d (diff)
downloadgcc-c43fa1f51a746777e557c1ca99b6111474c5c961.zip
gcc-c43fa1f51a746777e557c1ca99b6111474c5c961.tar.gz
gcc-c43fa1f51a746777e557c1ca99b6111474c5c961.tar.bz2
builtins.c (expand_builtin_strcmp): Defend against the possibility that gen_cmpstrsi may fail...
* builtins.c (expand_builtin_strcmp): Defend against the possibility that gen_cmpstrsi may fail: Stabilize the argument list against re-evaluation and expand the library call directly using this saved argument list if a cmpstrsi sequence can't be generated. (expand_builtin_strncmp): Likewise. * config/i386/i386.md (cmpstrsi, movstrsi): Disable with -Os. * gcc.c-torture/execute/string-opt-8.c: Don't test optimizations that inline strncmp as cmpstrsi on i386 when compiled with -Os. From-SVN: r72380
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/string-opt-8.c2
1 files changed, 1 insertions, 1 deletions
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 434de33..2316fce 100644
--- a/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c
+++ b/gcc/testsuite/gcc.c-torture/execute/string-opt-8.c
@@ -65,7 +65,7 @@ int main ()
s2 = s1; s3 = s1+4;
if (strncmp (++s2, ++s3+2, 1) >= 0 || s2 != s1+1 || s3 != s1+5)
abort();
-#if !defined(__OPTIMIZE__) || defined(__i386__)
+#if !defined(__OPTIMIZE__) || (defined(__i386__) && !defined(__OPTIMIZE_SIZE__))
/* 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;