public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30487]  New: Math implicit function in forall statement causes compiler error
@ 2007-01-16 20:33 icksa1 at gmail dot com
  2007-01-16 21:30 ` [Bug fortran/30487] " burnus at gcc dot gnu dot org
  2007-01-17  1:37 ` kargl at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: icksa1 at gmail dot com @ 2007-01-16 20:33 UTC (permalink / raw)
  To: gcc-bugs

Hi:
I noticed that whenever I use a math function (such as sqrt, cos, log) in a
forall all statement that further uses of that function caused gfortran to say
that the function has no implicit type. I've shown an example program below:

program test

  implicit none

  integer :: i
  real :: a, c(5) = (/1.0,2.0,3.0,4.0,5.0/), d(5)

  a = sqrt(2.0)

  d(:) = 0.0

  forall (i = 1:5, sqrt(c(i)) < 2.0)
     d(i) = i
  end forall

end program test


If I try to compile the above program I get the following error:

 In file test.f90:8

  a = sqrt(2.0)
         1
Error: Symbol 'sqrt' at (1) has no IMPLICIT type

If I comment out the line "a = sqrt(2.0)", everything works fine. Also, if I
don't use the sqrt test in the forall statement, everything works fine. If you
substitute other mathematical functions for sqrt (such as log or cos) it fails
to compile in a similar way.

I tried this in the latest experimental build (downloaded from the gfortran
wiki) and had similar problems.

Thank You


-- 
           Summary: Math implicit function in forall statement causes
                    compiler error
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: icksa1 at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/30487] Math implicit function in forall statement causes compiler error
  2007-01-16 20:33 [Bug fortran/30487] New: Math implicit function in forall statement causes compiler error icksa1 at gmail dot com
@ 2007-01-16 21:30 ` burnus at gcc dot gnu dot org
  2007-01-17  1:37 ` kargl at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-01-16 21:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2007-01-16 21:30 -------
Confirmed with gfortran 4.3.0 20070116.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|i686-pc-linux-gnu           |
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2007-01-16 21:30:26
               date|                            |


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/30487] Math implicit function in forall statement causes compiler error
  2007-01-16 20:33 [Bug fortran/30487] New: Math implicit function in forall statement causes compiler error icksa1 at gmail dot com
  2007-01-16 21:30 ` [Bug fortran/30487] " burnus at gcc dot gnu dot org
@ 2007-01-17  1:37 ` kargl at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-01-17  1:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from kargl at gcc dot gnu dot org  2007-01-17 01:37 -------
A workaround for this problem is place parentheses around the
mask in the forall.  The parentheses force evaluation of the
expression whereas gfortran is apparently taking a different
path through the compiler without.

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


-- 

kargl at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-01-17  1:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-16 20:33 [Bug fortran/30487] New: Math implicit function in forall statement causes compiler error icksa1 at gmail dot com
2007-01-16 21:30 ` [Bug fortran/30487] " burnus at gcc dot gnu dot org
2007-01-17  1:37 ` kargl at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).