Bug 43712 - ICE on improperly continued character constant
Summary: ICE on improperly continued character constant
Status: RESOLVED DUPLICATE of bug 42866
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.4.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code, openmp
Depends on:
Blocks:
 
Reported: 2010-04-09 21:30 UTC by Bill Long
Modified: 2010-04-20 11:33 UTC (History)
2 users (show)

See Also:
Host: x86_64-suse-linux
Target: x86_64-suse-linux
Build: x86_64-suse-linux
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Long 2010-04-09 21:30:07 UTC
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.
Comment 1 Jerry DeLisle 2010-04-09 21:40:23 UTC
Try using -std=f90 with and without -pedantic.  gfortran allows the missing ampersand as an extension.
Comment 2 Bill Long 2010-04-09 22:20:45 UTC
OK, no need to worry about the simple.f90 case.  The original test.f90 problem is the only issue.
Comment 3 Jerry DeLisle 2010-04-15 22:55:48 UTC
I tried this test case gfortran 4.6.0 (current trunk) and i do not get an ICE.

It just works. ???
Comment 4 Tobias Burnus 2010-04-16 05:54:52 UTC
(In reply to comment #3)
> I tried this test case gfortran 4.6.0 (current trunk) and i do not get an ICE.
> It just works. ???

Same here:
   gcc version 4.4.0 20090206  -- ICE
   gcc version 4.5.0 20100409  -- works
   gcc version 4.6.0 20100415  -- works

With -std=f95 -pedantic, I get the diagnostic for the continuation line.
Comment 5 Jakub Jelinek 2010-04-20 11:33:06 UTC
Please update your gfortran.

*** This bug has been marked as a duplicate of 42866 ***