1/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
2int a[1000];
3int b[1000];
4int size=1;
5int max=10000;
6#ifdef __mips
7/* We allow short memcpy()s for MIPS16.  */
8int __attribute__((nomips16))
9#endif
10int
11main()
12{
13  int i;
14  for (i=0;i<max; i++)
15    {
16      __builtin_memset (a, 10, size * sizeof (a[0]));
17      asm("");
18    }
19   return 0;
20}
21/* { dg-final-use { scan-ipa-dump "Single value 4 stringop" "profile"} } */
22/* The versioned memset of size 4 should be optimized to an assignment.  */
23/* { dg-final-use { scan-tree-dump "MEM\\\[\\(void .\\)&a\\\] = 168430090" "optimized"} } */
24/* { dg-final-use { cleanup-tree-dump "optimized" } } */
25/* { dg-final-use { cleanup-ipa-dump "profile" } } */
26