aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2006-05-02 19:54:20 +0000
committerJeff Law <law@redhat.com>2006-05-02 19:54:20 +0000
commit1e0891484ebf02764aae9c6748238c3f7e7c6594 (patch)
treefb6626d3659e936c2efbe650999f417c6e9eb12a /gcc/testsuite/gcc.c-torture
parent7a3bc807c8f7682b2b1f100ab80e5e98c35f1be8 (diff)
PR tree-optimization/27364
* tree-vrp.c (vrp_int_const_binop): Fix detection of overflow from multiply expressions. * gcc.c-torture/execute/pr27364.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@113481 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr27364.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr27364.c b/gcc/testsuite/gcc.c-torture/execute/pr27364.c
new file mode 100644
index 00000000000..aa608b2a2fe
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr27364.c
@@ -0,0 +1,13 @@
+int f(unsigned number_of_digits_to_use)
+{
+ if (number_of_digits_to_use >1294)
+ return 0;
+ return (number_of_digits_to_use * 3321928 / 1000000 + 1) /16;
+}
+
+int main(void)
+{
+ if (f(11) != 2)
+ __builtin_abort ();
+ exit (0);
+}