aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr58946.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr58946.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr58946.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr58946.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr58946.c
new file mode 100644
index 000000000..0ec5eba16
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr58946.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/58946 */
+
+int
+foo (unsigned int c)
+{
+ unsigned int d, e, f;
+ if ((int) c < 0)
+ d = 0;
+ else
+ d = c;
+ if (d == 0)
+ e = __INT_MAX__ + 1U;
+ else
+ e = d;
+ if ((int) e < 0)
+ f = 0;
+ else
+ f = e;
+ return f;
+}