annotate gcc/testsuite/gfortran.dg/inline_matmul_2.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 ! { dg-options "-ffrontend-optimize -finline-matmul-limit=0 -fdump-tree-original" }
kono
parents:
diff changeset
3 ! PR 37131 - no inlining with -finline-matmul-limit=0
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)
kono
parents:
diff changeset
18 if (sum(c-cres)>1e-4) call abort
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 calloc = matmul(a,b)
kono
parents:
diff changeset
21 if (sum(calloc-cres)>1e-4) call abort
kono
parents:
diff changeset
22 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) call abort
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)
kono
parents:
diff changeset
27 if (sum(calloc-cres)>1e-4) call abort
kono
parents:
diff changeset
28 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) call abort
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)
kono
parents:
diff changeset
33 if (sum(calloc-cres)>1e-4) call abort
kono
parents:
diff changeset
34 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) call abort
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)
kono
parents:
diff changeset
43 if (sum(cc-cres)>1e-4) call abort
kono
parents:
diff changeset
44 calloc = matmul(aa,bb)
kono
parents:
diff changeset
45 if (sum(calloc-cres)>1e-4) call abort
kono
parents:
diff changeset
46 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) call abort
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)
kono
parents:
diff changeset
52 if (sum(calloc-cres)>1e-4) call abort
kono
parents:
diff changeset
53 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) call abort
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)
kono
parents:
diff changeset
58 if (sum(calloc-cres)>1e-4) call abort
kono
parents:
diff changeset
59 if (any([size(calloc,1), size(calloc,2)] /= [3,4])) call abort
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 "original" } }