aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr108625.c
blob: 03fc2889c4f78d65b0accd69bee552dc86f5392f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-forwprop1 -fdump-tree-optimized" } */

unsigned char foo(int x)
{
  int t = -x;
  unsigned char t1 = t;
  unsigned char t2 = t;
  /* We may not rewrite this as (unsigned char)(t - x).  */
  return t1 + t2;
}

/* { dg-final { scan-tree-dump-times "x_" 1 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "x_" 1 "optimized" } } */