This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/15553] New: Array copy operation produces garbage
- From: "schnetter at aei dot mpg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 May 2004 13:25:08 -0000
- Subject: [Bug fortran/15553] New: Array copy operation produces garbage
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The attached programme fails with GNU Fortran 95 (GCC 3.5.0 20040520
(experimental)).
The programme packs the 2D array x. The array has the shape (10,10), of which
only the subarray (6,5) is used. The programme copies the 6*5=30 elements
into the "first" 30 elements of x, where "first" is here according to the
Fortran array ordering.
When run, I expect the output
11 11.0000000000000
12 12.0000000000000
13 13.0000000000000
14 14.0000000000000
15 15.0000000000000
16 16.0000000000000
17 21.0000000000000
18 22.0000000000000
19 23.0000000000000
20 24.0000000000000
21 25.0000000000000
22 26.0000000000000
23 31.0000000000000
24 32.0000000000000
25 33.0000000000000
26 34.0000000000000
27 35.0000000000000
28 36.0000000000000
29 41.0000000000000
30 42.0000000000000
31 43.0000000000000
32 44.0000000000000
33 45.0000000000000
34 46.0000000000000
35 51.0000000000000
36 52.0000000000000
37 53.0000000000000
38 54.0000000000000
39 55.0000000000000
40 56.0000000000000
but i receive only garbage:
11 5.030513618404220E-270
12 -1.99744415283204
13 -1.99659731990728
14 -1.99665522575300
15 0.00000000000000
16 0.00000000000000
17 0.00000000000000
18 2.334195370061799E-313
19 2.334195374458983E-313
20 1.060997895759312E-312
21 -1.99665832519531
22 1.141633735539316E-311
23 2.121995791459338E-314
24 2.121995791459338E-313
25 2.121995791014678E-313
26 0.00000000000000
27 0.00000000000000
28 1.273197474579163E-313
29 6.747412213442543E-270
30 9.555629329992950E-313
31 4.857336695425104E-270
32 -1.99665141105572
33 1.591495110041668E-314
34 0.00000000000000
35 0.00000000000000
36 0.00000000000000
37 1.888576254013439E-312
38 1.188317642994899E-312
39 2.470328229206232E-322
40 1.591495112017931E-314
--
Summary: Array copy operation produces garbage
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schnetter at aei dot mpg dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15553