[Bug fortran/27613] compile fails with Unclassifiable statement error message

2009-05-26 Thread theresa dot adelt at greselius dot net


--- Comment #13 from theresa dot adelt at greselius dot net  2009-05-26 
09:00 ---
Subject: Re:  compile fails with Unclassifiable statement error
 mess


Hello!

Thank you so much for answering.

But I think this is not the problem.
I added the '', but thereupon appeared a syntax error. I think it is because
in FORTRAN you have to use .AND.. So I changed this and now I got the error
with unclassifiable statement again.

[...@sm-pc17-linux Fortran-Kram]$ cat prim.f
program prim
! Testet, ob eine gegebene Zahl prim
integer :: kandidat, teiler, rest
kandidat = 7099
do teiler = 2, kandidat - 1
rest = MOD(kandidat, teiler)
if (rest == 0) THEN
write(*,*)kandidat, ' ist nicht Teiler' .AND.
  teiler, 'ist ein Teiler'
stop
end if
end do
write(*,*)kandidat, 'ist prim.'
stop
end program prim

[...@sm-pc17-linux Fortran-Kram]$ g95 -ffree-form prim.f
In file prim.f:8

write(*,*)kandidat, ' ist nicht Teiler' .AND.
 1
Error: Syntax error in expression at (1)
In file prim.f:9

  teiler, 'ist ein Teiler'
  1
Error: Unclassifiable statement at (1)


Oh, it's a little crazy. Now I recognize, that I've got the syntax error
anyhow. And changing .AND. with  again, I get only the Syntax error:

[...@sm-pc17-linux Fortran-Kram]$ cat prim.f
program prim
! Testet, ob eine gegebene Zahl prim
integer :: kandidat, teiler, rest
kandidat = 7099
do teiler = 2, kandidat - 1
rest = MOD(kandidat, teiler)
if (rest == 0) THEN
write(*,*)kandidat, ' ist nicht Teiler' 
  teiler, 'ist ein Teiler'
stop
end if
end do
write(*,*)kandidat, 'ist prim.'
stop
end program prim

[...@sm-pc17-linux Fortran-Kram]$ g95 -ffree-form prim.f
In file prim.f:9

  teiler, 'ist ein Teiler'
  1
Error: Syntax error in WRITE statement at (1)
[...@sm-pc17-linux Fortran-Kram]$ 


Do you now what I have made wrong.

I am so happy if anybody could help me.


Greetings,

Theresa




 --- Comment #12 from tobi at gcc dot gnu dot org  2009-05-19 15:55 ---
 
 Add an ampersand ()
 
 (In reply to comment #11)
  write(*,*)kandidat, ' ist nicht Teiler' 
here  ^^
 
 and be sure to read the section on continuation lines in your Fortran text.
 
 
 -- 
 
 
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27613
 
 --- You are receiving this mail because: ---
 You are on the CC list for the bug, or are watching someone who is.


-- 


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2009-05-26 Thread tobi at gcc dot gnu dot org


--- Comment #14 from tobi at gcc dot gnu dot org  2009-05-26 09:38 ---
- you're lacking a comma before the place I asked you to add an ampersand,
sorry I missed that
- g95 is not gfortran
- please direct beginner's questions somewhere more appropriate


-- 


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2009-05-19 Thread theresa dot adelt at greselius dot net


--- Comment #11 from theresa dot adelt at greselius dot net  2009-05-19 
15:45 ---
Hello!

I need help, too.

I want to compile with g95 the following easy program:

program prim
! Testet, ob eine gegebene Zahl prim
integer :: kandidat, teiler, rest
kandidat = 7099
do teiler = 2, kandidat - 1
rest = MOD(kandidat, teiler)
if (rest == 0) THEN
write(*,*)kandidat, ' ist nicht Teiler'
  teiler, 'ist ein Teiler'
stop
end if
end do
write(*,*)kandidat, 'ist prim.'
stop
end program prim


It is about testing if a number is a prime number or not.


The following error appeared:

In file prim.f:9

  teiler, 'ist ein Teiler'
 1
Error: Unclassifiable statement at (1)


What is wrong? Why is 'teiler' not classifiable, even though I write teiler=2?


I would be happy, if anybody could help me.


Thanks a lot.

Wishes from Germany.

Theresa


-- 

theresa dot adelt at greselius dot net changed:

   What|Removed |Added

 CC||theresa dot adelt at
   ||greselius dot net


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2009-05-19 Thread tobi at gcc dot gnu dot org


--- Comment #12 from tobi at gcc dot gnu dot org  2009-05-19 15:55 ---

Add an ampersand ()

(In reply to comment #11)
 write(*,*)kandidat, ' ist nicht Teiler' 
   here  ^^

and be sure to read the section on continuation lines in your Fortran text.


-- 


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message (fixed in trunk)

2006-05-28 Thread pault at gcc dot gnu dot org


--- Comment #8 from pault at gcc dot gnu dot org  2006-05-28 19:47 ---
Subject: Bug 27613

Author: pault
Date: Sun May 28 19:46:22 2006
New Revision: 114173

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=114173
Log:
2006-05-28  Paul Thomas  [EMAIL PROTECTED]

PR fortran/25082
* resolve.c (resolve_code): Add error condition that the return
expression must be scalar.

PR fortran/27411
* matchexp.c (gfc_get_parentheses): New function.
(match_primary): Remove inline code and call above.
* gfortran.h: Provide prototype for gfc_get_parentheses.
* resolve.c (resolve_array_ref): Call the above, when start is a
derived type variable array reference.

PR fortran/27613
* primary.c (gfc_match_rvalue): Test if symbol represents a
direct recursive function reference.  Error if array valued,
go to function0 otherwise.

PR fortran/25746
* interface.c (gfc_extend_assign): Use new EXEC_ASSIGN_CALL.
* gfortran.h : Put EXEC_ASSIGN_CALL in enum.
* trans-stmt.c (gfc_conv_elemental_dependencies): New function.
(gfc_trans_call): Call it.  Add new boolian argument to flag
need for dependency checking. Assert intent OUT and IN for arg1
and arg2.
(gfc_trans_forall_1): Use new code EXEC_ASSIGN_CALL.
trans-stmt.h : Modify prototype of gfc_trans_call.
trans.c (gfc_trans_code): Add call for EXEC_ASSIGN_CALL.
st.c (gfc_free_statement): Free actual for EXEC_ASSIGN_CALL.
* dependency.c (gfc_check_fncall_dependency): Don't check other
against itself.

PR fortran/27584
* check.c (gfc_check_associated): Replace NULL assert with an
error message, since it is possible to generate bad code that
has us fall through to here..

PR fortran/19015
* iresolve.c (maxloc, minloc): If DIM is not present, pass the
rank of ARRAY as the shape of the result.  Otherwise, pass the
shape of ARRAY, less the dimension DIM.
(maxval, minval): The same, when DIM is present, otherwise no
change.

PR fortran/27709
* resolve.c (find_array_spec): Add gfc_symbol, derived, and
use to track repeated component references.

PR fortran/27155
PR fortran/27449
* trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): Use
se-string_length throughout and use memcpy to populate the
expression returned to the scalarizer.
(gfc_size_in_bytes): New function.

* trans-intrinsic.c (gfc_conv_associated): If pointer in first
arguments has zero array length of zero string length, return
false.

2006-05-28  Paul Thomas  [EMAIL PROTECTED]

PR fortran/25082
* gfortran.dg/scalar_return_1.f90: New test.

PR fortran/27411
* gfortran.dg/derived_comp_array_ref_1.f90: New test.

PR fortran/25746
* gfortran.dg/elemental_subroutine_3.f90: New test.

PR fortran/27584
* gfortran.dg/associated_target_1.f90: New test.

PR fortran/19015
* gfortran.dg/maxloc_shape_1.f90: New test.

PR fortran/27613
* gfortran.dg/recursive_reference_1.f90: New test.

PR fortran/27709
* gfortran.dg/spec_expr_4.f90: New test.

PR fortran/27155
* gfortran.dg/transfer_array_intrinsic_4.f90: New test.

* gfortran.dg/associated_2.f90: New test.

Modified:
branches/gcc-4_1-branch/gcc/fortran/ChangeLog
branches/gcc-4_1-branch/gcc/fortran/check.c
branches/gcc-4_1-branch/gcc/fortran/gfortran.h
branches/gcc-4_1-branch/gcc/fortran/interface.c
branches/gcc-4_1-branch/gcc/fortran/iresolve.c
branches/gcc-4_1-branch/gcc/fortran/matchexp.c
branches/gcc-4_1-branch/gcc/fortran/primary.c
branches/gcc-4_1-branch/gcc/fortran/resolve.c
branches/gcc-4_1-branch/gcc/fortran/st.c
branches/gcc-4_1-branch/gcc/fortran/trans-intrinsic.c
branches/gcc-4_1-branch/gcc/fortran/trans-stmt.c
branches/gcc-4_1-branch/gcc/fortran/trans-stmt.h
branches/gcc-4_1-branch/gcc/fortran/trans.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message (fixed in trunk)

2006-05-28 Thread pault at gcc dot gnu dot org


--- Comment #9 from pault at gcc dot gnu dot org  2006-05-28 19:51 ---
Subject: Bug 27613

Author: pault
Date: Sun May 28 19:50:51 2006
New Revision: 114174

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=114174
Log:
2006-05-28  Paul Thomas  [EMAIL PROTECTED]

PR fortran/25082
* gfortran.dg/scalar_return_1.f90: New test.

PR fortran/27411
* gfortran.dg/derived_comp_array_ref_1.f90: New test.

PR fortran/25746
* gfortran.dg/elemental_subroutine_3.f90: New test.

PR fortran/27584
* gfortran.dg/associated_target_1.f90: New test.

PR fortran/19015
* gfortran.dg/maxloc_shape_1.f90: New test.

PR fortran/27613
* gfortran.dg/recursive_reference_1.f90: New test.

PR fortran/27709
* gfortran.dg/spec_expr_4.f90: New test.

PR fortran/27155
* gfortran.dg/transfer_array_intrinsic_4.f90: New test.

* gfortran.dg/associated_2.f90: New test.

Added:
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/associated_2.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/associated_target_1.f90
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/derived_comp_array_ref_1.f90
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/elemental_subroutine_3.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/maxloc_shape_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/recursive_reference_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/scalar_return_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/spec_expr_4.f90
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/transfer_array_intrinsic_4.f90


-- 


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2006-05-28 Thread pault at gcc dot gnu dot org


--- Comment #10 from pault at gcc dot gnu dot org  2006-05-28 19:56 ---
Fixed in trunk and 4.1

Paul


-- 

pault at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
Summary|compile fails with  |compile fails with
   |Unclassifiable statement  |Unclassifiable statement
   |error message (fixed in |error message
   |trunk)  |


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2006-05-21 Thread pault at gcc dot gnu dot org


--- Comment #6 from pault at gcc dot gnu dot org  2006-05-21 11:53 ---
Subject: Bug 27613

Author: pault
Date: Sun May 21 11:53:02 2006
New Revision: 113951

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=113951
Log:
2006-05-21  Paul Thomas  [EMAIL PROTECTED]

PR fortran/27613
* primary.c (gfc_match_rvalue): Test if symbol represents a
direct recursive function reference.  Error if array valued,
go to function0 otherwise.

2006-05-21  Paul Thomas  [EMAIL PROTECTED]

PR fortran/27613
* gfortran.dg/recursive_reference_1.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/recursive_reference_1.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/primary.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2006-05-21 Thread patchapp at dberlin dot org


--- Comment #7 from patchapp at dberlin dot org  2006-05-21 21:35 ---
Subject: Bug number PR27613

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-05/msg01044.html


-- 


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2006-05-18 Thread tobi at gcc dot gnu dot org


--- Comment #4 from tobi at gcc dot gnu dot org  2006-05-18 14:40 ---
Paul, I've looked at the patch and it looks ok.  You don't seem to have posted
it, at least it's not in the patch tracker.  Did you find any problems
associated with it?


-- 

tobi at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||tobi at gcc dot gnu dot org,
   ||paul dot richard dot thomas
   ||at cea dot fr


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2006-05-18 Thread paul dot richard dot thomas at cea dot fr


--- Comment #5 from paul dot richard dot thomas at cea dot fr  2006-05-18 
15:31 ---
(In reply to comment #4)
 Paul, I've looked at the patch and it looks ok.  You don't seem to have posted
 it, at least it's not in the patch tracker.  Did you find any problems
 associated with it?

I think that it is OK.  I prepared the submission, whereupon Grigory came up
with the problem with the fix for PR25090.  I dropped everything to fix the
fix!

I have also been bogged down with the problem with TRANSFER on 64bit machines.
It is not too easy to fix when you do not have a 64bit machine!

I will submit the patch in the next 24hours - promise!

Many thanks

Paul 


-- 


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2006-05-15 Thread paul dot richard dot thomas at cea dot fr


--- Comment #2 from paul dot richard dot thomas at cea dot fr  2006-05-15 
06:42 ---
A temporary workaround is:

program test
  integer :: stuff

  write(*, *) called stuff , stuff(1),  times

end program test

recursive function stuff(n) result (tmp)
  integer :: tmp
  integer :: n

  tmp = 1
  if(n  5) then
tmp = tmp+stuff(n+1)
  endif

end function stuff


-- 


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2006-05-15 Thread paul dot richard dot thomas at cea dot fr


--- Comment #3 from paul dot richard dot thomas at cea dot fr  2006-05-15 
13:59 ---
Created an attachment (id=11471)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11471action=view)
Patch for the problem

The attachment is a patch for the problem. The testcase is below.
Regtesting right now on Cygwin_NT/PIV
It will be submitted if all is well.

Paul

! { dg-do compile }
! Tests the patch for PR27613, in which directly recursive, scalar
! functions were generating an unclassifiable statement error
! for the recursive statement(s).
!
! Based on PR testcase by Nicolas Bock  [EMAIL PROTECTED]
!
program test
  if (original_stuff(1) .ne. 5) call abort ()
  if (scalar_stuff(-4) .ne. 10) call abort ()
  if (any (array_stuff((/-19,-30/)) .ne. (/25,25/))) call abort ()
contains
  recursive function original_stuff(n)
integer :: original_stuff
integer :: n
original_stuff = 1
if(n  5) then
  original_stuff = original_stuff + original_stuff (n+1)
endif
  end function original_stuff

  recursive function scalar_stuff(n) result (tmp)
integer :: tmp
integer :: n
tmp = 1
if(n  5) then
  tmp = tmp + scalar_stuff (n+1)
endif
  end function scalar_stuff

  recursive function array_stuff(n) result (tmp)
integer :: tmp (2)
integer :: n (2)
tmp = 1
if(maxval (n)  5) then
  tmp = tmp + array_stuff (n+1)
endif
  end function array_stuff

  recursive function bad_stuff(n)
integer :: bad_stuff (2)
integer :: n(2)
bad_stuff = 1
if(maxval (n)  5) then
  bad_stuff = bad_stuff + bad_stuff (n+1) ! { dg-error RESULT must be
specified }
endif
  end function bad_stuff
end program test


-- 


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2006-05-15 Thread pault at gcc dot gnu dot org


-- 

pault at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
   |dot org |
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2006-05-15 16:09:05
   date||


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



[Bug fortran/27613] compile fails with Unclassifiable statement error message

2006-05-14 Thread nicolasbock at gmail dot com


--- Comment #1 from nicolasbock at gmail dot com  2006-05-15 01:14 ---
I would like to add the output of

$ gfortran -v -save-temps test.f90
Driving: gfortran -v -save-temps test.f90 -lgfortranbegin -lgfortran
-shared-libgcc
Using built-in specs.
Target: powerpc-apple-darwin8.6.0
Configured with: ../gcc-4.1.0/configure --prefix=/usr/local/gcc-4.1.0
--with-gmp=/sw --with-mpfr=/sw --enable-languages=c,fortran --disable-libssp :
(reconfigured) ../gcc-4.1.0/configure --prefix=/usr/local/gcc-4.1.0
--with-gmp=/sw --with-mpfr=/sw --enable-languages=c,fortran --disable-multilib
Thread model: posix
gcc version 4.1.0
 /usr/local/gcc-4.1.0/libexec/gcc/powerpc-apple-darwin8.6.0/4.1.0/f951 test.f90
-fPIC -quiet -dumpbase test.f90 -auxbase test -version -o test.s
GNU F95 version 4.1.0 (powerpc-apple-darwin8.6.0)
compiled by GNU C version 4.0.0 (Apple Computer, Inc. build 5026).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 In file test.f90:14

stuff = stuff+stuff(n+1)
   1
Error: Unclassifiable statement at (1)


-- 


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