For the test case:

program F03_2_9_3_5_2b
   use omp_lib
   implicit none
   integer, parameter :: NT = 4
   integer, parameter :: int64_t = selected_int_kind(18)
   integer (kind=int64_t), parameter::DYNAMIC_MEMORY = 64000_int64_t
   integer (kind=int64_t), parameter::ARRAY_SIZE = DYNAMIC_MEMORY/NT/8
   integer, parameter :: EXPECTED_RESULT = 1
   logical :: fail = .false.
   integer :: i
   integer (kind=int64_t), allocatable :: A(:)

   call omp_set_num_threads(NT)
   call omp_set_dynamic(.false.)

   !$omp parallel
      if (omp_get_thread_num() == NT-1) then
         allocate(A(ARRAY_SIZE))
      end if

      !$omp barrier  ! ensure A is allocated before the sections region

      !$omp sections lastprivate(A)
         ! This thread sleeps to attempt to let the thread 
         ! that executes the next section get ahead.
         call sleep(5)
         A = EXPECTED_RESULT+1
         !$omp section
         A = EXPECTED_RESULT
      !$omp end sections ! implicit barrier at end of sections construct
      !$omp master
      ! verify that all elements of the array are EXPECTED_RESULT
      if (MAXVAL(A) /= EXPECTED_RESULT .or.  &
          MINVAL(A) /= EXPECTED_RESULT) then
         print *, 'FAIL - MAXVAL(A) == ', MAXVAL(A), &
                       ' (expected ', EXPECTED_RESULT, '), &
                          MINVAL(A) == ', MINVAL(A), &
                       ' (expected ', EXPECTED_RESULT, ')'
      end if
      !$omp end master
   !$omp end parallel

end program F03_2_9_3_5_2b
> gfortran -fopenmp test.f90
test.f90: In function 'f03_2_9_3_5_2b':
test.f90:23: internal compiler error: in single_pred_edge, at basic-block.h:658
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Expected message (Cray compiler):

> ftn -c test.f90
/opt/cray/xt-asyncpe/3.8.20/bin/ftn: INFO: linux target is being used

                          MINVAL(A) == ', MINVAL(A), &
                          ^                            
ftn-505 crayftn: ERROR F03_2_9_3_5_2B, File = test.f90, Line = 37, Column = 27 
  Continuation of character context in free source form requires an "&" as the
first nonblank character of the next line.



I tried a much simpler test:

> cat simple.f90
program test
  print *, "Beginning of string  &
           improperly continued"
end program test

For which the Cray compiler made a similar objection:

           improperly continued"
           ^                     
ftn-505 crayftn: ERROR TEST, File = simple.f90, Line = 3, Column = 12 
  Continuation of character context in free source form requires an "&" as the
first nonblank character of the next line.


However, the gfortran compiler did not object (it should have) and the code
actually worked in a reasonable way:

> gfortran simple.f90
> ./a.out
 Beginning of string  improperly continued
> 

At this point, I gave up on trying to reduce the original test case that caused
the ICE.


-- 
           Summary: ICE on improperly continued character constant
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: longb at cray dot com
 GCC build triplet: x86_64-suse-linux
  GCC host triplet: x86_64-suse-linux
GCC target triplet: x86_64-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43712

Reply via email to