File: cunroll-13.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (61 lines) | stat: -rw-r--r-- 1,542 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* { dg-do compile } */
/* { dg-options "-O3 -fgimple -fdump-tree-cunroll-blocks-details" } */

#if __SIZEOF_INT__ < 4
__extension__ typedef __INT32_TYPE__ i32;
#else
typedef int i32;
#endif

struct a {i32 a[8];i32 b;};

void __GIMPLE (ssa,startwith("fix_loops"))
t (struct a * a)
{
  i32 i;
  i32 _1;
  i32 _2;
  i32 _9;
  i32 _11;

__BB(2):
  _11 = a_6(D)->a[0];
  if (_11 != _Literal (i32) 0)
    goto __BB6;
  else
    goto __BB3;

__BB(3):
  return;

__BB(4):
  _1 = _2 + _Literal (i32) 1;
  a_6(D)->a[i_19] = _1;
  i_8 = i_19 + _Literal (i32) 1;
  if (i_8 <= _Literal (i32) 123455)
    goto __BB5;
  else
    goto __BB3;

__BB(5):
  i_19 = __PHI (__BB6: _Literal (i32) 1, __BB4: i_8);
  _2 = a_6(D)->a[i_19];
  if (_2 != _Literal (i32) 0)
    goto __BB4;
  else
    goto __BB3;

__BB(6):
  _9 = _11 + _Literal (i32) 1;
  a_6(D)->a[0] = _9;
  goto __BB5;
}

/* This testcase relies on the fact that we do not eliminate the redundant test
   for i early.  It is necessary to disable all passes that do so, for the
   moment starting with the loop pipeline is good enough.  */
/* { dg-final { scan-tree-dump-times "Loop 1 iterates 123454 times" 1 "cunroll" } } */
/* { dg-final { scan-tree-dump-times "Last iteration exit edge was proved true" 1 "cunroll" } } */
/* { dg-final { scan-tree-dump-times "Exit condition of peeled iterations was eliminated" 1 "cunroll" } } */
/* { dg-final { scan-tree-dump-times "loop with 6 iterations completely unrolled" 1 "cunroll" } } */
/* { dg-final { scan-tree-dump-not "Invalid sum" "cunroll" } } */