public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/27965]  New: gfortran gives "Array bound mismatch" for valid program
@ 2006-06-08 19:54 tobias dot burnus at physik dot fu-berlin dot de
  2006-06-08 20:18 ` [Bug fortran/27965] " tobias dot burnus at physik dot fu-berlin dot de
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tobias dot burnus at physik dot fu-berlin dot de @ 2006-06-08 19:54 UTC (permalink / raw)
  To: gcc-bugs

The following valid Fortran 95 program gives
  Fortran runtime error: Array bound mismatch
for GNU Fortran 95 (GCC) 4.1.0 (SUSE Linux) and
  Fortran runtime error: Array bound mismatch, upper bound of dimension 1 of
array 'rho' exceeded (in file 'main.f90', at line 12)
for GNU Fortran 95 (GCC) 4.2.0 20060608 (experimental).

-------<cut>--------------
program test
  implicit none
  real(8) :: rftp(4)
  rftp = 42.0_8
  call xcifc(n=4,rho=rftp)
contains
  subroutine xcifc(n,rho)
    implicit none
    integer, optional, intent(in) :: n
    real(8), optional, intent(in) :: rho(*)
    if(present(n).and.present(rho)) then
      print *,rho(1:n)
    end if
  end subroutine xcifc
end program test
--------------------------

Compiled as: gfortran -Wall -g -O0 -fbounds-check -Wconversion main.f90

If compiled without -fbounds-check, the output is ok.

Other compilers:
~> f95 -C=all -C=undefined -kind=byte main.f90 ; ./a.out
  42.0000000000000000  42.0000000000000000  42.0000000000000000 
42.0000000000000000
~> ifort -C -check all -warn all,nodec,interfaces -gen_interfaces -traceback
-fpe0 -fpstkchk -g -O0 main.f90; ./a.out
   42.0000000000000        42.0000000000000        42.0000000000000
   42.0000000000000


-- 
           Summary: gfortran gives "Array bound mismatch" for valid program
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tobias dot burnus at physik dot fu-berlin dot de


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


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

* [Bug fortran/27965] gfortran gives "Array bound mismatch" for valid program
  2006-06-08 19:54 [Bug fortran/27965] New: gfortran gives "Array bound mismatch" for valid program tobias dot burnus at physik dot fu-berlin dot de
@ 2006-06-08 20:18 ` tobias dot burnus at physik dot fu-berlin dot de
  2006-06-09  7:22 ` fxcoudert at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tobias dot burnus at physik dot fu-berlin dot de @ 2006-06-08 20:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tobias dot burnus at physik dot fu-berlin dot de  2006-06-08 19:53 -------
This could be the same as gfortran.fortran-torture/execute/assumed_size.f90,
I'm not completely sure, though.


-- 

tobias dot burnus at physik dot fu-berlin dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal


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


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

* [Bug fortran/27965] gfortran gives "Array bound mismatch" for valid program
  2006-06-08 19:54 [Bug fortran/27965] New: gfortran gives "Array bound mismatch" for valid program tobias dot burnus at physik dot fu-berlin dot de
  2006-06-08 20:18 ` [Bug fortran/27965] " tobias dot burnus at physik dot fu-berlin dot de
@ 2006-06-09  7:22 ` fxcoudert at gcc dot gnu dot org
  2006-06-16 17:04 ` fxcoudert at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-06-09  7:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2006-06-09 06:53 -------
My patch at http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00364.html fixes this
problem (I noted it during while designing the patch, but didn't fill a PR
because I knew it would be fixed soon :)

Thanks Tobias for your help testing -fbounds-check, I hope in the next few
weeks we can make it feature-full and bug-free :)


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |27766
              nThis|                            |
         AssignedTo|unassigned at gcc dot gnu   |fxcoudert at gcc dot gnu dot
                   |dot org                     |org
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2006-
                   |                            |06/msg00364.html
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
           Keywords|                            |patch
   Last reconfirmed|0000-00-00 00:00:00         |2006-06-09 06:53:17
               date|                            |


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


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

* [Bug fortran/27965] gfortran gives "Array bound mismatch" for valid program
  2006-06-08 19:54 [Bug fortran/27965] New: gfortran gives "Array bound mismatch" for valid program tobias dot burnus at physik dot fu-berlin dot de
  2006-06-08 20:18 ` [Bug fortran/27965] " tobias dot burnus at physik dot fu-berlin dot de
  2006-06-09  7:22 ` fxcoudert at gcc dot gnu dot org
@ 2006-06-16 17:04 ` fxcoudert at gcc dot gnu dot org
  2006-07-02 21:17 ` [Bug fortran/27965] [4.1 only] invalid "Array bound mismatch" runtime error fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-06-16 17:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from fxcoudert at gcc dot gnu dot org  2006-06-16 17:03 -------
Subject: Bug 27965

Author: fxcoudert
Date: Fri Jun 16 17:03:43 2006
New Revision: 114724

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114724
Log:
        PR fortran/27965
        * trans-array.c (gfc_conv_ss_startstride): Correct the runtime
        conditions for bounds-checking. Check for nonzero stride.
        Don't check the last dimension of assumed-size arrays. Fix the
        dimension displayed in the error message.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c


-- 


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


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

* [Bug fortran/27965] [4.1 only] invalid "Array bound mismatch" runtime error
  2006-06-08 19:54 [Bug fortran/27965] New: gfortran gives "Array bound mismatch" for valid program tobias dot burnus at physik dot fu-berlin dot de
                   ` (2 preceding siblings ...)
  2006-06-16 17:04 ` fxcoudert at gcc dot gnu dot org
@ 2006-07-02 21:17 ` fxcoudert at gcc dot gnu dot org
  2006-07-02 21:23 ` [Bug fortran/27965] " fxcoudert at gcc dot gnu dot org
  2006-07-02 22:37 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-07-02 21:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from fxcoudert at gcc dot gnu dot org  2006-07-02 21:17 -------
Subject: Bug 27965

Author: fxcoudert
Date: Sun Jul  2 21:17:05 2006
New Revision: 115134

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115134
Log:
        PR fortran/28094
        * trans-intrinsic.c (gfc_conv_intrinsic_mod): Support cases where
        there is no integer kind equal to the resulting real kind.
        * intrinsic.c (add_functions): MODULO is not allowed as an actual
        argument.
        * Makefile.am: Add _mod_r10.F90 and _mod_r16.F90.
        * Makefile.in: Regenerate.
        * generated/_mod_r10.F90: New file.
        * generated/_mod_r16.F90: New file.

        PR fortran/27965
        * trans-array.c (gfc_conv_ss_startstride): Correct the runtime
        conditions for bounds-checking. Check for nonzero stride.
        Don't check the last dimension of assumed-size arrays. Fix the
        dimension displayed in the error message.

        PR fortran/26801
        * trans-intrinsic.c (gfc_conv_associated): Use pre and post blocks
        of the scalarization expression.
        * gfortran.dg/associated_4.f90: New test.

        PR fortran/28081
        * resolve.c (resolve_substring): Don't issue out-of-bounds
        error messages when the range has zero size.
        * gfortran.dg/substr_3.f: New test.
        * gfortran.dg/equiv_2.f90: Update expected error message.

        PR fortran/23862
        * lang-specs.h (f95-cpp-input): Pass -ffree-form to f951 unless
        -ffixed-form is explicitly specified.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/associated_4.f90
      - copied unchanged from r114757,
trunk/gcc/testsuite/gfortran.dg/associated_4.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/substr_3.f
      - copied unchanged from r114972,
trunk/gcc/testsuite/gfortran.dg/substr_3.f
    branches/gcc-4_1-branch/libgfortran/generated/_mod_r10.F90
      - copied unchanged from r114961, trunk/libgfortran/generated/_mod_r10.F90
    branches/gcc-4_1-branch/libgfortran/generated/_mod_r16.F90
      - copied unchanged from r114961, trunk/libgfortran/generated/_mod_r16.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/fortran/lang-specs.h
    branches/gcc-4_1-branch/gcc/fortran/resolve.c
    branches/gcc-4_1-branch/gcc/fortran/trans-array.c
    branches/gcc-4_1-branch/gcc/fortran/trans-intrinsic.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/equiv_2.f90
    branches/gcc-4_1-branch/libgfortran/ChangeLog
    branches/gcc-4_1-branch/libgfortran/Makefile.am
    branches/gcc-4_1-branch/libgfortran/Makefile.in


-- 


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


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

* [Bug fortran/27965] invalid "Array bound mismatch" runtime error
  2006-06-08 19:54 [Bug fortran/27965] New: gfortran gives "Array bound mismatch" for valid program tobias dot burnus at physik dot fu-berlin dot de
                   ` (3 preceding siblings ...)
  2006-07-02 21:17 ` [Bug fortran/27965] [4.1 only] invalid "Array bound mismatch" runtime error fxcoudert at gcc dot gnu dot org
@ 2006-07-02 21:23 ` fxcoudert at gcc dot gnu dot org
  2006-07-02 22:37 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-07-02 21:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from fxcoudert at gcc dot gnu dot org  2006-07-02 21:23 -------
Fixed.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.1.2                       |
      Known to work|4.2.0                       |4.2.0 4.1.2
            Summary|[4.1 only] invalid "Array   |invalid "Array bound
                   |bound mismatch" runtime     |mismatch" runtime error
                   |error                       |
   Target Milestone|---                         |4.1.2


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


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

* [Bug fortran/27965] invalid "Array bound mismatch" runtime error
  2006-06-08 19:54 [Bug fortran/27965] New: gfortran gives "Array bound mismatch" for valid program tobias dot burnus at physik dot fu-berlin dot de
                   ` (4 preceding siblings ...)
  2006-07-02 21:23 ` [Bug fortran/27965] " fxcoudert at gcc dot gnu dot org
@ 2006-07-02 22:37 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-02 22:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-07-02 22:37 -------
Fixed so closing.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2006-07-02 22:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-08 19:54 [Bug fortran/27965] New: gfortran gives "Array bound mismatch" for valid program tobias dot burnus at physik dot fu-berlin dot de
2006-06-08 20:18 ` [Bug fortran/27965] " tobias dot burnus at physik dot fu-berlin dot de
2006-06-09  7:22 ` fxcoudert at gcc dot gnu dot org
2006-06-16 17:04 ` fxcoudert at gcc dot gnu dot org
2006-07-02 21:17 ` [Bug fortran/27965] [4.1 only] invalid "Array bound mismatch" runtime error fxcoudert at gcc dot gnu dot org
2006-07-02 21:23 ` [Bug fortran/27965] " fxcoudert at gcc dot gnu dot org
2006-07-02 22:37 ` 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).