Bug 31594 - gfortran failed to compiled a 'valid' code
Summary: gfortran failed to compiled a 'valid' code
Status: VERIFIED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-16 23:06 UTC by Deji Akingunola
Modified: 2007-04-17 22:09 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
testcase (cut and paste from original) (887 bytes, text/x-fortran)
2007-04-16 23:07 UTC, Deji Akingunola
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Deji Akingunola 2007-04-16 23:06:23 UTC
The attached fortran code (a smaller section cut and paste from original) was generated by a custom preprocessor. The code very much seems to be valid fortran 77, though its has some weird tab spacings; It compiles (and executes) fine with pgf90 and ifort-8.x. The compile time error is as below (same with  gfortran-4.1.2, 4.2 and 4.3.0 trunck build);

[armnlib@agape ~]$ gfortran -c -fcray-pointer adw_test.f 
adw_test.f:61.9:

         a(m,1) = p(m,1) * F_in  (o1(m,1)-1) + p(m,2) * F_in  (o1(m,1)) 
        1
Error: Unclassifiable statement at (1)
adw_test.f:90.8:

     %(m,3) * F_in  (o1(m,3)+1) + p(m,4) * F_in  (o1(m,3)+2)            
       1
Error: Expected PARAMETER symbol in complex constant at (1)
adw_test.f:94.8:

     %(m,3) * F_in  (o3(m,3)+1) + p(m,4) * F_in  (o3(m,3)+2)            
       1
Error: Expected PARAMETER symbol in complex constant at (1)
Comment 1 Deji Akingunola 2007-04-16 23:07:35 UTC
Created attachment 13374 [details]
testcase (cut and paste from original)

I can provide the whole file if necessary
Comment 2 Tobias Schlüter 2007-04-17 01:20:22 UTC
Your lines are too wide, hoping that bugzilla will not mess up the formatting I'll quote an example:
         1         2         3         4         5         6         7
123456789012345678901234567890123456789012345678901234567890123456789012345
    	  a(m,1) = p(m,1) * F_in  (o1(m,1)-1) + p(m,2) * F_in  (o1(m,1)) + 
     %p(m,3) * F_in  (o1(m,1)+1) + p(m,4) * F_in  (o1(m,1)+2)
                                                                        ^^
Per the standard, fixed form lines are 72 characters and everything beyond is ignored, so the plus is not read.  The -ffixed-line-length option should solve your problem.

Closing as INVALID.
Comment 3 Steven Bosscher 2007-04-17 07:12:51 UTC
To the reporter:
Even though this is already (correctly) closed as INVALID, please let us know if your code does compile and run correctly if you compile with the suggested extra command line option, -ffixed-line-length.
Comment 4 Tobias Schlüter 2007-04-17 12:14:38 UTC
(In reply to comment #3)
> To the reporter:
> Even though this is already (correctly) closed as INVALID, please let us know
> if your code does compile and run correctly if you compile with the suggested
> extra command line option, -ffixed-line-length.

Yes, sorry, I forgot to say that.

Comment 5 Deji Akingunola 2007-04-17 13:21:34 UTC
Yes adding compiling with -ffixed-line-length-80 solved the issue for me, thanks to you both. I've noticed the original author of that code used tabs in a couple of space he should have used spaces, the other compilers I tried with probably sees the tab as a single separator while gfortran fleshed it out to 3 spaces. I've added -ffixed-line-length-80 to the Makefile to handle similar other cases in the model.
Comment 6 Steven Bosscher 2007-04-17 22:09:54 UTC
.