[Bug fortran/81826] New: Incorrect handling of directives left by preprocessor

2017-08-11 Thread raullaasner at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81826

Bug ID: 81826
   Summary: Incorrect handling of directives left by preprocessor
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: raullaasner at gmail dot com
  Target Milestone: ---

I am trying to compile a preprocessed Fortran source file that contains a
syntax error:

  $ cat main.f90 
implicit none
a = 5
  end program
  $ gfortran -cpp -E main.f90 -o main.f90.pp.f90
  $ gfortran main.f90.pp.f90 
  main.f90.pp.f90:2:3:

   # 1 ""
 1
  Error: Symbol ‘a’ at (1) has no IMPLICIT type

The problem is that the error message refers to the preprocessed file and not
the original source file. Also, it is showing an incorrect line above the
number "1", which should be the offending line. This is unlike the C compiler:

  $ cat main.c
  int main() // {
return 0;
  }
  $ gcc -E main.c -o main.c.pp.c
  $ gcc main.c.pp.c 
  main.c: In function ‘main’:
  main.c:2:3: error: expected declaration specifiers before ‘return’
 return 0;
 ^~
  main.c:3:1: error: expected declaration specifiers before ‘}’ token
   }
   ^
  main.c:3:1: error: expected ‘{’ at end of input

where the error message refers to the correct source file (main.c:2:3).

This issue was brought up at
https://gitlab.kitware.com/cmake/cmake/issues/17160#note_301744 and it inhibits
the correct behavior of CMake with the Ninja generator.

[Bug fortran/81826] Incorrect handling of directives left by preprocessor

2017-08-11 Thread raullaasner at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81826

Raul Laasner  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Raul Laasner  ---
Thank you! This seems to work. Because I had no such issues with ifort, I
assumed it was a gfortran bug.

[Bug fortran/67076] New: Critical inside a module procedure

2015-07-31 Thread raullaasner at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67076

Bug ID: 67076
   Summary: Critical inside a module procedure
   Product: gcc
   Version: 5.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: raullaasner at gmail dot com
  Target Milestone: ---

With OpenCoarrays (1.0.0) and MPICH (3.1.3) I get

  [raul@x220 tests]$ cat Critical.f90
  module m
  contains
subroutine f()
  critical
  end critical
end subroutine f
  end module m
  end program
  [raul@x220 tests]$ mpif90 -fcoarray=lib Critical.f90 libcaf_mpi.a 
  f951: internal compiler error: in gfc_enforce_clean_symbol_state, at
  fortran/symbol.c:3749
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <https://bugs.archlinux.org/> for instructions.

The build is successful only with -fcoarray=single.