Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gfortran.dg / g77 / 13037.f
blob01c2bab19b33c2db64c85a67a12d33cc86c82cce
1 c { dg-do run }
2 c PR optimization/13037
3 c Contributed by Kirill Smelkov
4 c bug symptom: zeta(kkzc) seems to reference to zeta(kkzc-1) instead
5 c with gcc-3.2.2 it is OK, so it is a regression.
7 subroutine bug1(expnt)
8 implicit none
10 double precision zeta
11 common /bug1_area/zeta(3)
13 double precision expnt(3)
16 integer k, kkzc
18 kkzc=0
19 do k=1,3
20 kkzc = kkzc + 1
21 zeta(kkzc) = expnt(k)
22 enddo
24 c the following line activates the bug
25 call bug1_activator(kkzc)
26 end
29 c dummy subroutine
30 subroutine bug1_activator(inum)
31 implicit none
32 integer inum
33 end
36 c test driver
37 program test_bug1
38 implicit none
40 double precision zeta
41 common /bug1_area/zeta(3)
43 double precision expnt(3)
45 zeta(1) = 0.0d0
46 zeta(2) = 0.0d0
47 zeta(3) = 0.0d0
49 expnt(1) = 1.0d0
50 expnt(2) = 2.0d0
51 expnt(3) = 3.0d0
53 call bug1(expnt)
54 if ((zeta(1).ne.1) .or. (zeta(2).ne.2) .or. (zeta(3).ne.3)) then
55 call abort
56 endif
58 end