aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2005-01-06 19:10:56 +0000
committerRichard Henderson <rth@gcc.gnu.org>2005-01-06 11:10:56 -0800
commit27916b83f5f371d27f728fcc003fe93b0e44b3cc (patch)
tree19e9dc3f1ffa12be4d4551159477f7db64176090 /gcc/testsuite
parent4ab8006314c6e08c6e63e0743bf0a7e18c38792f (diff)
downloadgcc-27916b83f5f371d27f728fcc003fe93b0e44b3cc.zip
gcc-27916b83f5f371d27f728fcc003fe93b0e44b3cc.tar.gz
gcc-27916b83f5f371d27f728fcc003fe93b0e44b3cc.tar.bz2
re PR rtl-optimization/13299 (Unsafe treatment of extended givs)
PR rtl-opt/13299 * loop.c (get_monotonic_increment, biased_biv_fits_mode_p, biv_fits_mode_p, extension_within_bounds_p): New functions. (check_ext_dependent_givs): Use them. From-SVN: r93000
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030916-1.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030916-1.c b/gcc/testsuite/gcc.c-torture/execute/20030916-1.c
new file mode 100644
index 0000000..8b460c6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20030916-1.c
@@ -0,0 +1,35 @@
+/* "i" overflows in f(). Check that x[i] is not treated as a giv. */
+#include <limits.h>
+
+#if CHAR_BIT == 8
+
+void f (unsigned int *x)
+{
+ unsigned char i;
+ int j;
+
+ i = 0x10;
+ for (j = 0; j < 0x10; j++)
+ {
+ i += 0xe8;
+ x[i] = 0;
+ i -= 0xe7;
+ }
+}
+
+int main ()
+{
+ unsigned int x[256];
+ int i;
+
+ for (i = 0; i < 256; i++)
+ x[i] = 1;
+ f (x);
+ for (i = 0; i < 256; i++)
+ if (x[i] != (i >= 0x08 && i < 0xf8))
+ abort ();
+ exit (0);
+}
+#else
+int main () { exit (0); }
+#endif