public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29441]  New: mathematical functions and constant expressions
@ 2006-10-12 14:58 kamaraju at gmail dot com
  2006-10-12 15:10 ` [Bug fortran/29441] non-constant parameter (constant) accepted pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: kamaraju at gmail dot com @ 2006-10-12 14:58 UTC (permalink / raw)
  To: gcc-bugs

Hi
  conside the following code

$cat const_math_func.f90
program printpi
  ! This program is not standard complaint
  real, parameter :: pi = 4.0*atan(1.0)
  write(*,*) pi
end program

This code is not Fortran 95 standard compliant (
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/11eeb6ec2896183c/95d5ab27eb5e94e9#95d5ab27eb5e94e9
). But still gfortran does not give any errors/warning when compiling this
code.

$gfortran -Wall -std=f95 const_math_func.f90

$./a.out
   3.141593

$gfortran -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --with-tune=i686
--enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20060901 (prerelease) (Debian 4.1.1-13)


-- 
           Summary: mathematical functions and constant expressions
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kamaraju at gmail dot com


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


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

* [Bug fortran/29441] non-constant parameter (constant) accepted
  2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
@ 2006-10-12 15:10 ` pinskia at gcc dot gnu dot org
  2006-10-12 15:12 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12 15:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-10-12 15:10 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.2.0
   Last reconfirmed|0000-00-00 00:00:00         |2006-10-12 15:10:40
               date|                            |
            Summary|mathematical functions and  |non-constant parameter
                   |constant expressions        |(constant) accepted
            Version|unknown                     |4.1.2


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


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

* [Bug fortran/29441] non-constant parameter (constant) accepted
  2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
  2006-10-12 15:10 ` [Bug fortran/29441] non-constant parameter (constant) accepted pinskia at gcc dot gnu dot org
@ 2006-10-12 15:12 ` pinskia at gcc dot gnu dot org
  2006-11-22 15:01 ` tobi at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12 15:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-10-12 15:12 -------
Actually adding -pedantic, and this is rejected:
 In file t.f90:3

  real, parameter :: pi = 4.0*atan(1.0)
                                 1
Error: Extension: Evaluation of nonstandard initialization expression at (1)

And has since 4.0.3:
[pinskia@celery ~]$ ~/gcc-4.0/bin/gfortran t.f90 -std=f95 -pedantic-errors
 In file t.f90:3

  real, parameter :: pi = 4.0*atan(1.0)
                                 1
Error: Extension: Evaluation of nonstandard initialization expression at (1)
[pinskia@celery ~]$ ~/gcc-4.1/bin/gfortran t.f90 -std=f95 -pedantic-errors
 In file t.f90:3

  real, parameter :: pi = 4.0*atan(1.0)
                                 1
Error: Extension: Evaluation of nonstandard initialization expression at (1)


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.2.0                       |


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


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

* [Bug fortran/29441] non-constant parameter (constant) accepted
  2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
  2006-10-12 15:10 ` [Bug fortran/29441] non-constant parameter (constant) accepted pinskia at gcc dot gnu dot org
  2006-10-12 15:12 ` pinskia at gcc dot gnu dot org
@ 2006-11-22 15:01 ` tobi at gcc dot gnu dot org
  2006-11-22 22:09 ` tobi at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2006-11-22 15:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tobi at gcc dot gnu dot org  2006-11-22 15:01 -------
I have a one-line patch for this.


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tobi at gcc dot gnu dot org
                   |dot org                     |
           Severity|normal                      |enhancement
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-10-12 15:10:40         |2006-11-22 15:01:27
               date|                            |


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


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

* [Bug fortran/29441] non-constant parameter (constant) accepted
  2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
                   ` (2 preceding siblings ...)
  2006-11-22 15:01 ` tobi at gcc dot gnu dot org
@ 2006-11-22 22:09 ` tobi at gcc dot gnu dot org
  2007-02-28 20:57 ` [Bug fortran/29441] [4.1/4.2 only] " burnus at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2006-11-22 22:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tobi at gcc dot gnu dot org  2006-11-22 22:09 -------
Subject: Bug 29441

Author: tobi
Date: Wed Nov 22 22:09:14 2006
New Revision: 119101

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119101
Log:
fortran/
        PR fortran/29441
        * intrinsic.c (gfc_intrinsic_func_interface): Always check if
        intrinsic is allowed in initialization expression.
testsuite/
        PR fortran/29441
        * gfortran.dg/initialization_4.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/initialization_4.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/29441] [4.1/4.2 only] non-constant parameter (constant) accepted
  2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
                   ` (3 preceding siblings ...)
  2006-11-22 22:09 ` tobi at gcc dot gnu dot org
@ 2007-02-28 20:57 ` burnus at gcc dot gnu dot org
  2007-03-01 13:24 ` tobi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-02-28 20:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from burnus at gcc dot gnu dot org  2007-02-28 20:57 -------
> Author: tobi
> Date: Wed Nov 22 22:09:14 2006
>    trunk/gcc/fortran/ChangeLog

What is the status on this? Will this be backported to 4.2 and 4.1?


-- 


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


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

* [Bug fortran/29441] [4.1/4.2 only] non-constant parameter (constant) accepted
  2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
                   ` (4 preceding siblings ...)
  2007-02-28 20:57 ` [Bug fortran/29441] [4.1/4.2 only] " burnus at gcc dot gnu dot org
@ 2007-03-01 13:24 ` tobi at gcc dot gnu dot org
  2007-03-01 15:52 ` tobi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-03-01 13:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from tobi at gcc dot gnu dot org  2007-03-01 13:24 -------
Consider it done.  Thanks for the reminder.  I should click on "My Bugs" more
often.


-- 


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


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

* [Bug fortran/29441] [4.1/4.2 only] non-constant parameter (constant) accepted
  2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
                   ` (5 preceding siblings ...)
  2007-03-01 13:24 ` tobi at gcc dot gnu dot org
@ 2007-03-01 15:52 ` tobi at gcc dot gnu dot org
  2007-03-01 16:41 ` tobi at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-03-01 15:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from tobi at gcc dot gnu dot org  2007-03-01 15:52 -------
Subject: Bug 29441

Author: tobi
Date: Thu Mar  1 15:52:28 2007
New Revision: 122431

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122431
Log:
fortran/
Backport from trunk
PR fortran/29441
* intrinsic.c (gfc_intrinsic_func_interface): Always check if
intrinsic is allowed in initialization expression.
testsuite/
* gfortran.dg/initialization_4.f90: New test.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/initialization_4.f90
      - copied unchanged from r119101,
trunk/gcc/testsuite/gfortran.dg/initialization_4.f90
Modified:
    branches/gcc-4_2-branch/gcc/fortran/ChangeLog
    branches/gcc-4_2-branch/gcc/fortran/intrinsic.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/29441] [4.1/4.2 only] non-constant parameter (constant) accepted
  2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
                   ` (6 preceding siblings ...)
  2007-03-01 15:52 ` tobi at gcc dot gnu dot org
@ 2007-03-01 16:41 ` tobi at gcc dot gnu dot org
  2007-03-01 16:43 ` tobi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-03-01 16:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from tobi at gcc dot gnu dot org  2007-03-01 16:40 -------
Subject: Bug 29441

Author: tobi
Date: Thu Mar  1 16:40:34 2007
New Revision: 122433

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122433
Log:
fortran/
Backport from trunk
PR fortran/29441
* intrinsic.c (gfc_intrinsic_func_interface): Always check if
intrinsic is allowed in initialization expression.
testsuite/
Backport from trunk
PR fortran/29441
* gfortran.dg/initialization_4.f90: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/initialization_4.f90
      - copied unchanged from r119101,
trunk/gcc/testsuite/gfortran.dg/initialization_4.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/intrinsic.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/29441] [4.1/4.2 only] non-constant parameter (constant) accepted
  2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
                   ` (7 preceding siblings ...)
  2007-03-01 16:41 ` tobi at gcc dot gnu dot org
@ 2007-03-01 16:43 ` tobi at gcc dot gnu dot org
  2007-03-05  9:29 ` burnus at gcc dot gnu dot org
  2007-03-05 13:15 ` tobi at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-03-01 16:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from tobi at gcc dot gnu dot org  2007-03-01 16:43 -------
Fixed on all release branches.


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.3


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


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

* [Bug fortran/29441] [4.1/4.2 only] non-constant parameter (constant) accepted
  2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
                   ` (8 preceding siblings ...)
  2007-03-01 16:43 ` tobi at gcc dot gnu dot org
@ 2007-03-05  9:29 ` burnus at gcc dot gnu dot org
  2007-03-05 13:15 ` tobi at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-03-05  9:29 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 620 bytes --]



------- Comment #10 from burnus at gcc dot gnu dot org  2007-03-05 09:29 -------
(In reply to comment #9) Tobias Schlüter wrote:
> Fixed on all release branches.

This sounds as if should have been marked as FIXED.
Did so. Please reopen if it should not have been closed.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug fortran/29441] [4.1/4.2 only] non-constant parameter (constant) accepted
  2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
                   ` (9 preceding siblings ...)
  2007-03-05  9:29 ` burnus at gcc dot gnu dot org
@ 2007-03-05 13:15 ` tobi at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-03-05 13:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from tobi at gcc dot gnu dot org  2007-03-05 13:14 -------
Thanks.


-- 


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


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

end of thread, other threads:[~2007-03-05 13:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-12 14:58 [Bug fortran/29441] New: mathematical functions and constant expressions kamaraju at gmail dot com
2006-10-12 15:10 ` [Bug fortran/29441] non-constant parameter (constant) accepted pinskia at gcc dot gnu dot org
2006-10-12 15:12 ` pinskia at gcc dot gnu dot org
2006-11-22 15:01 ` tobi at gcc dot gnu dot org
2006-11-22 22:09 ` tobi at gcc dot gnu dot org
2007-02-28 20:57 ` [Bug fortran/29441] [4.1/4.2 only] " burnus at gcc dot gnu dot org
2007-03-01 13:24 ` tobi at gcc dot gnu dot org
2007-03-01 15:52 ` tobi at gcc dot gnu dot org
2007-03-01 16:41 ` tobi at gcc dot gnu dot org
2007-03-01 16:43 ` tobi at gcc dot gnu dot org
2007-03-05  9:29 ` burnus at gcc dot gnu dot org
2007-03-05 13:15 ` tobi 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).