public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/15962] New: constant expression not recognized as such
@ 2004-06-12 14:45 Mart dot Rentmeester at nn-online dot org
  2004-06-13  9:09 ` [Bug fortran/15962] [gfortran] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Mart dot Rentmeester at nn-online dot org @ 2004-06-12 14:45 UTC (permalink / raw)
  To: gcc-bugs

In the following code a constant expression isn't
recognized as such. The compiler generates an error.


troogle> gfortran -v -c !$
gfortran -v -c n10.f95
Reading specs from /OPT/32/gcc-2004-06-09/lib/gcc/hppa2.0w-hp-hpux11.11/3.5.
0/specs
Configured with: ../configure --enable-languages=c,f95 
--prefix=/opt32/gcc-2004-06-09 --with-gmp=/opt32/gmp --with-gnu-as 
--with-as=/opt32/binutils/bin/as --enable-threads --disable-shared --disable-nls
Thread model: posix
gcc version 3.5.0 20040611 (experimental)
 /OPT/32/gcc-2004-06-09/libexec/gcc/hppa2.0w-hp-hpux11.11/3.5.0/f951 n10.f95 
-quiet -dumpbase n10.f95 -auxbase n10 -version -o /var/tmp//ccoTgXEW.s
GNU F95 version 3.5.0 20040611 (experimental) (hppa2.0w-hp-hpux11.11)
        compiled by GNU C version 3.5.0 20040611 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

 In file n10.f95:9

case (1:size(i))
       1
Error: Expression in CASE statement at (1) must be a constant






function x(k)

implicit none
integer, intent(in) :: k
integer             :: x
integer, parameter  :: i(10) = (/1,2,3,4,5,6,7,8,9,10/)

select case(k)
case (1:size(i))
    x = i(k)
case default
    x = 0
end select

end function x

-- 
           Summary: constant expression not recognized as such
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Mart dot Rentmeester at nn-online dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug fortran/15962] [gfortran] constant expression not recognized as such
  2004-06-12 14:45 [Bug fortran/15962] New: constant expression not recognized as such Mart dot Rentmeester at nn-online dot org
@ 2004-06-13  9:09 ` pinskia at gcc dot gnu dot org
  2004-06-15 17:01 ` tobi at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-13  9:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-13 09:09 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-13 09:09:08
               date|                            |
            Summary|constant expression not     |[gfortran] constant
                   |recognized as such          |expression not recognized as
                   |                            |such


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


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

* [Bug fortran/15962] [gfortran] constant expression not recognized as such
  2004-06-12 14:45 [Bug fortran/15962] New: constant expression not recognized as such Mart dot Rentmeester at nn-online dot org
  2004-06-13  9:09 ` [Bug fortran/15962] [gfortran] " pinskia at gcc dot gnu dot org
@ 2004-06-15 17:01 ` tobi at gcc dot gnu dot org
  2004-06-15 18:12 ` tobi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-06-15 17:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-06-15 17:01 -------
1. the error is wrong for the same reason your code is valid: an initialization
expression is required, not a constant expression.
2. I have a patch which I'm testing right now.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2004-06-13 09:09:08         |2004-06-15 17:01:09
               date|                            |


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


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

* [Bug fortran/15962] [gfortran] constant expression not recognized as such
  2004-06-12 14:45 [Bug fortran/15962] New: constant expression not recognized as such Mart dot Rentmeester at nn-online dot org
  2004-06-13  9:09 ` [Bug fortran/15962] [gfortran] " pinskia at gcc dot gnu dot org
  2004-06-15 17:01 ` tobi at gcc dot gnu dot org
@ 2004-06-15 18:12 ` tobi at gcc dot gnu dot org
  2004-06-15 21:51 ` cvs-commit at gcc dot gnu dot org
  2004-06-16  6:49 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-06-15 18:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-06-15 18:12 -------
Patch here: http://gcc.gnu.org/ml/fortran/2004-06/msg00170.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug fortran/15962] [gfortran] constant expression not recognized as such
  2004-06-12 14:45 [Bug fortran/15962] New: constant expression not recognized as such Mart dot Rentmeester at nn-online dot org
                   ` (2 preceding siblings ...)
  2004-06-15 18:12 ` tobi at gcc dot gnu dot org
@ 2004-06-15 21:51 ` cvs-commit at gcc dot gnu dot org
  2004-06-16  6:49 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-15 21:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-15 21:50 -------
Subject: Bug 15962

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tobi@gcc.gnu.org	2004-06-15 21:50:51

Modified files:
	gcc/fortran    : ChangeLog match.c resolve.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/lib: f-torture.exp 
Added files:
	gcc/testsuite/gfortran.fortran-torture/execute: select_1.f90 

Log message:
	fortran/
	PR fortran/15962
	* match.c (match_case_selector): Call gfc_match_init_expr
	instead of gfc_match_expr.
	* resolve.c (validate_case_label_expr): No need to check for
	constant, since it wouldn't have been matched with the fix to
	match.c.
	testsuite/
	PR fortran/15962
	* gfortran.fortran-torture/execute/select_1.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.75&r2=1.76
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/match.c.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&r1=1.5&r2=1.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3860&r2=1.3861
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/execute/select_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/lib/f-torture.exp.diff?cvsroot=gcc&r1=1.12&r2=1.13



-- 


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


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

* [Bug fortran/15962] [gfortran] constant expression not recognized as such
  2004-06-12 14:45 [Bug fortran/15962] New: constant expression not recognized as such Mart dot Rentmeester at nn-online dot org
                   ` (3 preceding siblings ...)
  2004-06-15 21:51 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-16  6:49 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-16  6:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-16 06:49 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


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


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

end of thread, other threads:[~2004-06-16  6:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-12 14:45 [Bug fortran/15962] New: constant expression not recognized as such Mart dot Rentmeester at nn-online dot org
2004-06-13  9:09 ` [Bug fortran/15962] [gfortran] " pinskia at gcc dot gnu dot org
2004-06-15 17:01 ` tobi at gcc dot gnu dot org
2004-06-15 18:12 ` tobi at gcc dot gnu dot org
2004-06-15 21:51 ` cvs-commit at gcc dot gnu dot org
2004-06-16  6:49 ` pinskia 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).