summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/pr21030.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/pr21030.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr21030.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr21030.c b/gcc/testsuite/gcc.c-torture/compile/pr21030.c
new file mode 100644
index 000000000..b7590c0ed
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr21030.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/21030
+ VRP used to create invalid ranges where VR->MIN is greater than
+ VR->MAX. */
+
+void
+foo (int unit)
+{
+ int i;
+
+ for (i = 0; unit; i++, unit--)
+ {
+ if (i >= 0)
+ {
+ int j = i;
+ while (j)
+ j--;
+ }
+ }
+}