aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr110068-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/pr110068-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr110068-1.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr110068-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr110068-1.c
new file mode 100644
index 0000000..df88553
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr110068-1.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/95699 */
+/* PR tree-optimization/110068 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-phiopt1" } */
+/* { dg-final { scan-tree-dump-times "MIN_EXPR " 2 "phiopt1" } } */
+
+#define min1(x,y) ((x) < (y) ? (x) : (y))
+unsigned
+f1 (unsigned x)
+{
+ return min1(x, 1U<<(sizeof(x)*8-1));
+}
+unsigned
+f5 (unsigned x)
+{
+ bool t = x >= 1U<<(sizeof(x)*8-1);
+ if (!t)
+ ;
+ else
+ x = 1U<<(sizeof(x)*8-1);
+ return x;
+}