aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/muldiv-1.c
blob: 91612dc9de46b702ad6b73d291d9c3b5c69e06af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-optimized-raw" } */

// ldist produces (((q-p-4)/4)&...+1)*4
// Make sure we remove at least the division
// Eventually this should just be n*4

void foo(int*p, __SIZE_TYPE__ n){
  for(int*q=p+n;p!=q;++p)*p=0;
}

/* { dg-final { scan-tree-dump "builtin_memset" "optimized" } } */
/* { dg-final { scan-tree-dump-not "div" "optimized" } } */