public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31059] Detect nonconforming assignment of allocatable arrays
       [not found] <bug-31059-4@http.gcc.gnu.org/bugzilla/>
@ 2010-12-29 15:23 ` dfranke at gcc dot gnu.org
  2010-12-29 15:24 ` dfranke at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu.org @ 2010-12-29 15:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Daniel Franke <dfranke at gcc dot gnu.org> 2010-12-29 15:22:44 UTC ---
*** Bug 32454 has been marked as a duplicate of this bug. ***


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

* [Bug fortran/31059] Detect nonconforming assignment of allocatable arrays
       [not found] <bug-31059-4@http.gcc.gnu.org/bugzilla/>
  2010-12-29 15:23 ` [Bug fortran/31059] Detect nonconforming assignment of allocatable arrays dfranke at gcc dot gnu.org
@ 2010-12-29 15:24 ` dfranke at gcc dot gnu.org
  2023-08-30 20:53 ` [Bug fortran/31059] bounds-check does not detect nonconforming assignment arrays anlauf at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu.org @ 2010-12-29 15:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Daniel Franke <dfranke at gcc dot gnu.org> 2010-12-29 15:22:47 UTC ---
*** Bug 34741 has been marked as a duplicate of this bug. ***


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

* [Bug fortran/31059] bounds-check does not detect nonconforming assignment arrays
       [not found] <bug-31059-4@http.gcc.gnu.org/bugzilla/>
  2010-12-29 15:23 ` [Bug fortran/31059] Detect nonconforming assignment of allocatable arrays dfranke at gcc dot gnu.org
  2010-12-29 15:24 ` dfranke at gcc dot gnu.org
@ 2023-08-30 20:53 ` anlauf at gcc dot gnu.org
  2023-08-31 20:15 ` anlauf at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-08-30 20:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31059

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #9 from anlauf at gcc dot gnu.org ---
Created attachment 55821
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55821&action=edit
Partial patch (proof of concept)

The attached patch adds bounds-checking for the case that the r.h.s. has
only an array constructor.

Note the the original testcase is bogus, as it does not prevent (re)allocation
on assignment, which became default in F2003.

Adjusted testcase:

program p
  integer              :: jvec(3) = [1,2,3]
  integer, allocatable :: ivec(:)
  allocate (ivec(2))
  ivec(:) = [4,5,6] ! shall be detected
  ivec(:) = jvec    ! already detected
end

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

* [Bug fortran/31059] bounds-check does not detect nonconforming assignment arrays
       [not found] <bug-31059-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2023-08-30 20:53 ` [Bug fortran/31059] bounds-check does not detect nonconforming assignment arrays anlauf at gcc dot gnu.org
@ 2023-08-31 20:15 ` anlauf at gcc dot gnu.org
  2023-08-31 20:44 ` anlauf at gcc dot gnu.org
  2023-09-01 20:42 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-08-31 20:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31059

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #55821|0                           |1
        is obsolete|                            |

--- Comment #10 from anlauf at gcc dot gnu.org ---
Created attachment 55828
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55828&action=edit
Improved patch

This one also handles arbitrary order of array section and constructor.

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

* [Bug fortran/31059] bounds-check does not detect nonconforming assignment arrays
       [not found] <bug-31059-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2023-08-31 20:15 ` anlauf at gcc dot gnu.org
@ 2023-08-31 20:44 ` anlauf at gcc dot gnu.org
  2023-09-01 20:42 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-08-31 20:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31059

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |anlauf at gcc dot gnu.org

--- Comment #11 from anlauf at gcc dot gnu.org ---
Submitted: https://gcc.gnu.org/pipermail/fortran/2023-August/059722.html

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

* [Bug fortran/31059] bounds-check does not detect nonconforming assignment arrays
       [not found] <bug-31059-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2023-08-31 20:44 ` anlauf at gcc dot gnu.org
@ 2023-09-01 20:42 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-01 20:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31059

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:6f06152541d62ae7c8579b7d7bf552be19e15b05

commit r14-3633-g6f06152541d62ae7c8579b7d7bf552be19e15b05
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Thu Aug 31 22:19:58 2023 +0200

    Fortran: runtime bounds-checking in presence of array constructors
[PR31059]

    gcc/fortran/ChangeLog:

            PR fortran/31059
            * trans-array.cc (gfc_conv_ss_startstride): For array bounds
checking,
            consider also array constructors in expressions, and use their
shape.

    gcc/testsuite/ChangeLog:

            PR fortran/31059
            * gfortran.dg/bounds_check_fail_5.f90: New test.

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

end of thread, other threads:[~2023-09-01 20:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-31059-4@http.gcc.gnu.org/bugzilla/>
2010-12-29 15:23 ` [Bug fortran/31059] Detect nonconforming assignment of allocatable arrays dfranke at gcc dot gnu.org
2010-12-29 15:24 ` dfranke at gcc dot gnu.org
2023-08-30 20:53 ` [Bug fortran/31059] bounds-check does not detect nonconforming assignment arrays anlauf at gcc dot gnu.org
2023-08-31 20:15 ` anlauf at gcc dot gnu.org
2023-08-31 20:44 ` anlauf at gcc dot gnu.org
2023-09-01 20:42 ` cvs-commit at gcc dot gnu.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).