summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/g77/980519-2.f
blob: 3134a00b5cdef27a1e5694705ac86af3edfba2b5 (plain)
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
c { dg-do compile }
* Date: Fri, 17 Apr 1998 14:12:51 +0200
* From: Jean-Paul Jeannot <jeannot@gx-tech.fr>
* Organization: GX Technology France
* To: egcs-bugs@cygnus.com
* Subject: identified bug in g77 on Alpha
* 
* Dear Sir,
* 
* You will find below the assembly code of a simple Fortran routine which
* crashes with segmentation fault when storing the first element 
*       in( jT_f-hd_T     ) = Xsp
* whereas everything is fine when commenting this line.
* 
* The assembly code (generated with 
* -ffast-math -fexpensive-optimizations -fomit-frame-pointer -fno-inline
* or with -O5)
* uses a zapnot instruction to copy an address.
* BUT the zapnot parameter is 15 (copuing 4 bytes) instead of 255 (to copy
* 8 bytes). 
* 
* I guess this is typically a 64 bit issue. As, from my understanding,
* zapnots are used a lot to copy registers, this may create problems
* elsewhere.
* 
* Thanks for your help
* 
* Jean-Paul Jeannot
* 
      subroutine simul_trace( in, Xsp, Ysp, Xrcv, Yrcv )

c   Next declaration added on transfer to gfortran testsuite
      integer hd_S, hd_Z, hd_T

      common /Idim/ jT_f, jT_l, nT, nT_dim
      common /Idim/ jZ_f, jZ_l, nZ, nZ_dim
      common /Idim/ jZ2_f, jZ2_l, nZ2, nZ2_dim
      common /Idim/ jzs_f, jzs_l, nzs, nzs_dim, l_amp
      common /Idim/ hd_S, hd_Z, hd_T
      common /Idim/ nlay, nlayz
      common /Idim/ n_work
      common /Idim/ nb_calls

      real Xsp, Ysp, Xrcv, Yrcv
      real in( jT_f-hd_T : jT_l )

      in( jT_f-hd_T     ) = Xsp
      in( jT_f-hd_T + 1 ) = Ysp 
      in( jT_f-hd_T + 2 ) = Xrcv
      in( jT_f-hd_T + 3 ) = Yrcv
      end