annotate gcc/testsuite/gfortran.dg/inline_matmul_3.f90 @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 ! { dg-options "-O3 -finline-matmul-limit=2 -fdump-tree-optimized" }
kono
parents:
diff changeset
3 ! PR 37131 - all calls to matmul should be kept
kono
parents:
diff changeset
4 program main
kono
parents:
diff changeset
5 real, dimension(3,2) :: a
kono
parents:
diff changeset
6 real, dimension(2,4) :: b
kono
parents:
diff changeset
7 real, dimension(3,4) :: c
kono
parents:
diff changeset
8 real, dimension(3,4) :: cres
kono
parents:
diff changeset
9 real, dimension(:,:), allocatable :: calloc
kono
parents:
diff changeset
10 integer :: a1 = size(a,1), a2 = size(a,2)
kono
parents:
diff changeset
11 integer :: b1 = size(b,1), b2 = size(b,2)
kono
parents:
diff changeset
12 integer :: c1 = size(c,1), c2 = size(c,2)
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 data a / 2., -3., 5., -7., 11., -13./
kono
parents:
diff changeset
15 data b /17., -23., 29., -31., 37., -39., 41., -47./
kono
parents:
diff changeset
16 data cres /195., -304., 384., 275., -428., 548., 347., -540., 692., 411., -640., 816./
kono
parents:
diff changeset
17 c = matmul(a,b)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
18 if (sum(c-cres)>1e-4) STOP 1
111
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 calloc = matmul(a,b)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
21 if (sum(calloc-cres)>1e-4) STOP 2
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
22 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) STOP 3
111
kono
parents:
diff changeset
23 deallocate(calloc)
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 allocate(calloc(4,4))
kono
parents:
diff changeset
26 calloc = matmul(a,b)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
27 if (sum(calloc-cres)>1e-4) STOP 4
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
28 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) STOP 5
111
kono
parents:
diff changeset
29 deallocate(calloc)
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 allocate(calloc(3,3))
kono
parents:
diff changeset
32 calloc = matmul(a,b)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
33 if (sum(calloc-cres)>1e-4) STOP 6
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
34 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) STOP 7
111
kono
parents:
diff changeset
35 deallocate(calloc)
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 block
kono
parents:
diff changeset
38 real :: aa(a1, a2), bb(b1, b2), cc(c1, c2)
kono
parents:
diff changeset
39 aa = a
kono
parents:
diff changeset
40 bb = b
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 cc = matmul(aa,bb)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
43 if (sum(cc-cres)>1e-4) STOP 8
111
kono
parents:
diff changeset
44 calloc = matmul(aa,bb)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
45 if (sum(calloc-cres)>1e-4) STOP 9
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
46 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) STOP 10
111
kono
parents:
diff changeset
47 calloc = 42.
kono
parents:
diff changeset
48 deallocate(calloc)
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 allocate(calloc(4,4))
kono
parents:
diff changeset
51 calloc = matmul(aa,bb)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
52 if (sum(calloc-cres)>1e-4) STOP 11
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
53 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) STOP 12
111
kono
parents:
diff changeset
54 deallocate(calloc)
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 allocate(calloc(3,3))
kono
parents:
diff changeset
57 calloc = matmul(aa,bb)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
58 if (sum(calloc-cres)>1e-4) STOP 13
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
59 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) STOP 14
111
kono
parents:
diff changeset
60 deallocate(calloc)
kono
parents:
diff changeset
61 end block
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 end program main
kono
parents:
diff changeset
64 ! { dg-final { scan-tree-dump-times "_gfortran_matmul" 8 "optimized" } }