public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/36754]  New: Compile-time bound-checking for allocatable arrays with known bonds
@ 2008-07-07 19:44 burnus at gcc dot gnu dot org
  2008-07-07 19:52 ` [Bug fortran/36754] " tkoenig at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-07-07 19:44 UTC (permalink / raw)
  To: gcc-bugs

The following bounds problem is not detected with gfortran at compile time (it
is at run time):

integer,allocatable :: a(:)
integer :: b(1)
allocate(a(12))
b = a(1:12)
end

Expected: The same output as NAG f95 has:
  Error: a.f90, line 4: Different vector lengths (1 and 12)


-- 
           Summary: Compile-time bound-checking for allocatable arrays with
                    known bonds
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 27766
             nThis:


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
@ 2008-07-07 19:52 ` tkoenig at gcc dot gnu dot org
  2008-07-07 19:58 ` dominiq at lps dot ens dot fr
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-07-07 19:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tkoenig at gcc dot gnu dot org  2008-07-07 19:51 -------
Confirmed.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-07-07 19:51:18
               date|                            |


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
  2008-07-07 19:52 ` [Bug fortran/36754] " tkoenig at gcc dot gnu dot org
@ 2008-07-07 19:58 ` dominiq at lps dot ens dot fr
  2008-07-07 22:47 ` burnus at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-07-07 19:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dominiq at lps dot ens dot fr  2008-07-07 19:57 -------
> Confirmed.

How do I get:

pr36754.f90:4.1:

b = a(1:12)
1
Error: Different shape for array assignment at (1) on dimension 1 (1 and 12)

? I don't have that many patches left.


-- 


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
  2008-07-07 19:52 ` [Bug fortran/36754] " tkoenig at gcc dot gnu dot org
  2008-07-07 19:58 ` dominiq at lps dot ens dot fr
@ 2008-07-07 22:47 ` burnus at gcc dot gnu dot org
  2008-07-09 14:50 ` tkoenig at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-07-07 22:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2008-07-07 22:46 -------
> b = a(1:12)
> Error: Different shape for array assignment at (1) on dimension 1 (1 and 12)
> ? I don't have that many patches left.

Hmm, I currently get the same (with all gfortrans I have). I really wonder why
I did not get this before. Let me recheck tomorrow.


-- 


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-07-07 22:47 ` burnus at gcc dot gnu dot org
@ 2008-07-09 14:50 ` tkoenig at gcc dot gnu dot org
  2009-01-04  0:13 ` dfranke at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-07-09 14:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tkoenig at gcc dot gnu dot org  2008-07-09 14:49 -------
(In reply to comment #3)
> > b = a(1:12)
> > Error: Different shape for array assignment at (1) on dimension 1 (1 and 12)
> > ? I don't have that many patches left.
> 
> Hmm, I currently get the same (with all gfortrans I have). I really wonder why
> I did not get this before. Let me recheck tomorrow.

Same thing here.

What doesn't raise a warning, but could, is

integer,allocatable :: a(:)
integer :: b(1)
allocate(a(12))
b = a
end


-- 


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-07-09 14:50 ` tkoenig at gcc dot gnu dot org
@ 2009-01-04  0:13 ` dfranke at gcc dot gnu dot org
  2009-04-26 16:44 ` dominiq at lps dot ens dot fr
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-01-04  0:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dfranke at gcc dot gnu dot org  2009-01-04 00:13 -------
(In reply to comment #3)
> Let me recheck tomorrow.

Found anything?


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-01-04  0:13 ` dfranke at gcc dot gnu dot org
@ 2009-04-26 16:44 ` dominiq at lps dot ens dot fr
  2009-04-26 16:54 ` burnus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-04-26 16:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dominiq at lps dot ens dot fr  2009-04-26 16:43 -------
I get an error at compile time with gfortran 4.2.3, 4.3.3, 4.4.0, and trunk
(intel-darwin9). Is this PR valid?


-- 


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-04-26 16:44 ` dominiq at lps dot ens dot fr
@ 2009-04-26 16:54 ` burnus at gcc dot gnu dot org
  2009-04-26 17:39 ` dominiq at lps dot ens dot fr
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-04-26 16:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from burnus at gcc dot gnu dot org  2009-04-26 16:54 -------
> I get an error at compile time with gfortran 4.2.3, 4.3.3, 4.4.0, and trunk
> (intel-darwin9). Is this PR valid?

Good question - I get now the same error for comment 0, which makes the report
INVALID<already implemented since a long time>.

I don't get an error for comment 4. I think it is in principle detectable, but
difficult -> WONTFIX?

At run time, I get for comment 4 "(0/11)" instead of the proper "(1/12)", but I
think the off-by-one bug is tracked elsewhere.


-- 


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-04-26 16:54 ` burnus at gcc dot gnu dot org
@ 2009-04-26 17:39 ` dominiq at lps dot ens dot fr
  2009-04-26 17:47 ` dominiq at lps dot ens dot fr
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-04-26 17:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dominiq at lps dot ens dot fr  2009-04-26 17:38 -------
> I don't get an error for comment 4. I think it is in principle detectable, but
> difficult -> WONTFIX?

Confirmed. It may already be in one (or several) opened PR in the [meta]
PR27766. I have started to look at it, but it is quite messy.


-- 


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2009-04-26 17:39 ` dominiq at lps dot ens dot fr
@ 2009-04-26 17:47 ` dominiq at lps dot ens dot fr
  2009-04-29 14:29 ` dominiq at lps dot ens dot fr
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-04-26 17:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from dominiq at lps dot ens dot fr  2009-04-26 17:47 -------
> I don't get an error for comment 4.

This may be a duplicate of PR36683(?).


-- 


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2009-04-26 17:47 ` dominiq at lps dot ens dot fr
@ 2009-04-29 14:29 ` dominiq at lps dot ens dot fr
  2010-04-16 17:01 ` kargl at gcc dot gnu dot org
  2010-04-16 17:28 ` burnus at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-04-29 14:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from dominiq at lps dot ens dot fr  2009-04-29 14:28 -------
> This may be a duplicate of PR36683(?).

It is not.


-- 


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2009-04-29 14:29 ` dominiq at lps dot ens dot fr
@ 2010-04-16 17:01 ` kargl at gcc dot gnu dot org
  2010-04-16 17:28 ` burnus at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: kargl at gcc dot gnu dot org @ 2010-04-16 17:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from kargl at gcc dot gnu dot org  2010-04-16 17:00 -------
(In reply to comment #7)
> > I get an error at compile time with gfortran 4.2.3, 4.3.3, 4.4.0, and trunk
> > (intel-darwin9). Is this PR valid?
> 
> Good question - I get now the same error for comment 0, which makes the report
> INVALID<already implemented since a long time>.
> 
> I don't get an error for comment 4. I think it is in principle detectable, but
> difficult -> WONTFIX?
> 
> At run time, I get for comment 4 "(0/11)" instead of the proper "(1/12)", but I
> think the off-by-one bug is tracked elsewhere.
> 

The off-by-one bug is fixed.

laptop:kargl[286] gfc4x -o z -fcheck=bounds g.f90
laptop:kargl[287] ./z
At line 4 of file g.f90
Fortran runtime error: Array bound mismatch, size mismatch for dimension 1 of
array 'b' (1/12)

Can we close this PR?


-- 


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


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

* [Bug fortran/36754] Compile-time bound-checking for allocatable arrays with known bonds
  2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2010-04-16 17:01 ` kargl at gcc dot gnu dot org
@ 2010-04-16 17:28 ` burnus at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-04-16 17:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from burnus at gcc dot gnu dot org  2010-04-16 17:28 -------
Indeed looks fixed; thus, I closed it.


-- 

burnus at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2010-04-16 17:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-07 19:44 [Bug fortran/36754] New: Compile-time bound-checking for allocatable arrays with known bonds burnus at gcc dot gnu dot org
2008-07-07 19:52 ` [Bug fortran/36754] " tkoenig at gcc dot gnu dot org
2008-07-07 19:58 ` dominiq at lps dot ens dot fr
2008-07-07 22:47 ` burnus at gcc dot gnu dot org
2008-07-09 14:50 ` tkoenig at gcc dot gnu dot org
2009-01-04  0:13 ` dfranke at gcc dot gnu dot org
2009-04-26 16:44 ` dominiq at lps dot ens dot fr
2009-04-26 16:54 ` burnus at gcc dot gnu dot org
2009-04-26 17:39 ` dominiq at lps dot ens dot fr
2009-04-26 17:47 ` dominiq at lps dot ens dot fr
2009-04-29 14:29 ` dominiq at lps dot ens dot fr
2010-04-16 17:01 ` kargl at gcc dot gnu dot org
2010-04-16 17:28 ` burnus 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).