summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorglisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-03 12:21:14 +0000
committerglisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-03 12:21:14 +0000
commit4f5712bd2b23b68ba510f4ed99018df2a7c5fb93 (patch)
tree567eda01e87e579ad9caa799953466f4a2dfb161 /gcc/testsuite
parentbfa091eeca8305aee66359c5333e854ad3f2ddc1 (diff)
downloadgcc-4f5712bd2b23b68ba510f4ed99018df2a7c5fb93.tar.gz
gcc/
2012-08-03 Marc Glisse <marc.glisse@inria.fr> PR tree-optimization/30318 * double-int.c (mul_double_wide_with_sign): New function. (mul_double_with_sign): Call the new function. * double-int.h (mul_double_wide_with_sign): Declare the new function. * tree-vrp.c (extract_range_from_binary_expr_1) [MULT_EXPR]: Handle integer types that wrap on overflow. (quad_int_cmp): New helper function. (quad_int_pair_sort): Likewise. gcc/testsuite/ 2012-08-03 Marc Glisse <marc.glisse@inria.fr> PR tree-optimization/30318 * gcc.dg/tree-ssa/vrp77.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190125 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp77.c47
2 files changed, 52 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cde4e40bc6c..b7486f97c28 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-03 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/30318
+ * gcc.dg/tree-ssa/vrp77.c: New testcase.
+
2012-08-03 Marc Glisse <marc.glisse@inria.fr>
* g++.dg/ext/vector17.C: New testcase.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp77.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp77.c
new file mode 100644
index 00000000000..c0a8a865388
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp77.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+#ifdef __SIZEOF_INT128__
+#define T __int128
+#else
+#define T long long
+#endif
+
+extern void impossible (void);
+
+void f(T x)
+{
+ unsigned T y;
+ unsigned T z;
+ if (x < -7)
+ return;
+ if (x > 2)
+ return;
+ y = x;
+ z = y * y;
+ if (z == 666)
+ impossible ();
+}
+
+void g(unsigned T x)
+{
+ unsigned T y;
+ unsigned T z;
+ unsigned T m = -1;
+ m = m / 2;
+ if (x < m-2)
+ return;
+ if (x > m-1)
+ return;
+ y = x;
+ z = y * y;
+ /* The product (ignoring it is a square) has only 3 possible values:
+ 4, 9 and 2^127+6. At least one of the values 7, 666 and -666 is
+ known to be impossible. 7 is the most logical in the current
+ implementation. */
+ if (z == 7)
+ impossible ();
+}
+
+/* { dg-final { scan-tree-dump-not "impossible" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */