[GOMP4, OpenACC] Fixed-form Fortran code failing to parse

Cesar Philippidis cesar@codesourcery.com
Tue Jul 8 03:02:00 GMT 2014


On 07/04/2014 01:40 AM, Thomas Schwinge wrote:

> On Wed, 02 Jul 2014 14:53:19 +0200, I wrote:
>> I understand the attached fixed.f to be well-formed fixed-form Fortran
>> code, but it fails to parse in OpenACC mode:
> 
> The legacy of Fortran ;-) strikes again:
> 
>     $ gcc/xgcc -Bgcc/ -Bx86_64-unknown-linux-gnu/lib{gomp,gfortran}/ -Bx86_64-unknown-linux-gnu/lib{gomp,gfortran}/.libs -Ix86_64-unknown-linux-gnu/lib{gomp,gfortran} -I../source/lib{gomp,gfortran} -Lx86_64-unknown-linux-gnu/lib{gomp,gfortran}/.libs -Wl,-rpath,"$PWD"/x86_64-unknown-linux-gnu/lib{gomp,gfortran}/.libs ../../fixed-3.f -fopenacc -c
>     ../../fixed-3.f:7.6:
>     
>     *$ACC END PARALLEL                                                      
>           1
>     Error: Unclassifiable OpenACC directive at (1)
> 
> ..., and again:
> 
>     $ gcc/xgcc -Bgcc/ -Bx86_64-unknown-linux-gnu/lib{gomp,gfortran}/ -Bx86_64-unknown-linux-gnu/lib{gomp,gfortran}/.libs -Ix86_64-unknown-linux-gnu/lib{gomp,gfortran} -I../source/lib{gomp,gfortran} -Lx86_64-unknown-linux-gnu/lib{gomp,gfortran}/.libs -Wl,-rpath,"$PWD"/x86_64-unknown-linux-gnu/lib{gomp,gfortran}/.libs ../../fixed-4.f -fopenacc -c
>     ../../fixed-4.f:3.6:
>     
>     *$ACC PARALLEL                                                          
>           1
>     Error: Unclassifiable OpenACC directive at (1)
> 
> The corresponding OpenMP examples parse fine.
> 
> 
>> We should then also be adding some test coverage for fixed-form mode in
>> gcc/testsuite/gfortran.dg/goacc/.

Yeah. It doesn't look like there was any openacc testing in fixed-form
mode. This time, there were a couple of typos in scanner which caused
gfc_next_char and friends to fail when handling fixed-form comments.
There was also something being handled strangely in the parser, when I
went ahead and fixed. I think there may be a few more bugs lurking in
the fixed-form comment handling.

Thomas, is this OK for gomp-4_0-branch?

Cesar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: more-fixed-form-fixes.diff
Type: text/x-patch
Size: 2517 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140708/67bd1457/attachment.bin>


More information about the Fortran mailing list