Bug 166480
| Summary: | gfortran: bad recyling of format in input | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Need Real Name <jari.oksanen> |
| Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
| Status: | CLOSED RAWHIDE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 4 | ||
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | i386 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | 4.0.1-13 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2005-09-07 16:33:18 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Fixed in upstream GCC HEAD/gcc-4_0-branch with http://gcc.gnu.org/ml/gcc-patches/2005-09/msg00126.html Will show up in the next gcc-4.0.x rpms. Should be fixed in libgfortran-4.0.1-13. |
From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050719 Fedora/1.7.10-1.5.1 Description of problem: FORTRAN code compile with gfortran cycles input FORMAT in a wrong way and leads into corrputed reading. The issue is specific to gfortran: g77 does not have this problem (compat-gcc-32-g77-3.2.3-47.fc4). Here is a demonstration This is the FORTRAN code that has this problem. [jarioksa@biol102145 cepread]$ cat repio.f C Input with Fortran format (I6, (T7,6F2.0)) C Where the last parenthesized part should be C recycled. real vec(15) integer nrow, ncol read(5, 101) nrow, (vec(i), i=1,15) write(6, 104), nrow, (vec(i), i=1,15) 101 format(i6, (t7, 6f2.0)) 104 format(i5, 15f7.1) close(1) stop end These are the input data: [jarioksa@biol102145 cepread]$ cat in.dat 001 1 2 3 4 5 6 000000 7 8 9101112 000000131415 (The zeros were added just to make it more readable and show that columns are correct). Here is the result when compiled using g77: the numbers are wrong from input data line 3: [jarioksa@biol102145 cepread]$ gfortran repio.f -o repio [jarioksa@biol102145 cepread]$ ./repio < in.dat 1 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 1.0 31.0 41.0 STOP 0 Here the same code compiled with g77: [jarioksa@biol102145 cepread]$ g77 repio.f -o repio [jarioksa@biol102145 cepread]$ ./repio < in.dat 1 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 This is correct. So the problem is specific to gfortran 4.0.1. Version-Release number of selected component (if applicable): gcc-gfortran-4.0.1-4.fc4 How reproducible: Always Steps to Reproduce: 1. Compile the FORTRAN example above using gfortran. 2. Run with the input data provided. 3. See the wrong results. Actual Results: Data read in wrognly. Expected Results: Data read in correctly. Additional info: